2008-01-11 15:31:10 +00:00
|
|
|
# Copyright 2007-2008 Roy Marples <roy@marples.name>
|
|
|
|
# All rights reserved. Released under the 2-clause BSD license.
|
2007-11-14 15:22:04 +00:00
|
|
|
|
2009-01-29 13:38:15 +00:00
|
|
|
# mount $RC_SVCDIR as something we can write to if it's not rw
|
2007-04-05 11:18:42 +00:00
|
|
|
# On vservers, / is always rw at this point, so we need to clean out
|
|
|
|
# the old service state data
|
2008-06-21 15:31:04 +00:00
|
|
|
RC_SVCDIR=${RC_SVCDIR:-/@LIB@/rc/init.d}
|
2009-01-29 13:38:15 +00:00
|
|
|
case "$(rc --sys)" in
|
|
|
|
OPENVZ|VSERVER) rm -rf "${RC_SVCDIR}"/*;;
|
|
|
|
*) if mountinfo --quiet "${RC_SVCDIR}"; then
|
|
|
|
rm -rf "${RC_SVCDIR}"/*
|
|
|
|
else
|
|
|
|
mount_svcdir
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
retval=$?
|
2007-04-05 11:18:42 +00:00
|
|
|
|
2008-11-03 15:31:01 +00:00
|
|
|
if [ -e "${RC_LIBDIR}"/cache/deptree ]; then
|
|
|
|
cp -p "${RC_LIBDIR}"/cache/* "${RC_SVCDIR}" 2>/dev/null
|
|
|
|
fi
|
|
|
|
|
2007-04-05 11:18:42 +00:00
|
|
|
echo "sysinit" > "${RC_SVCDIR}/softlevel"
|
2008-01-31 09:48:58 +00:00
|
|
|
exit ${retval}
|