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
|
|
|
|
2008-01-31 09:48:58 +00:00
|
|
|
retval=0
|
|
|
|
|
2007-04-05 11:18:42 +00:00
|
|
|
# mount $svcdir as something we can write to if it's not rw
|
|
|
|
# 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}
|
2008-01-31 09:48:58 +00:00
|
|
|
if [ "${RC_SVCDIR}" != "/" ] && mkdir "${RC_SVCDIR}/.test.$$" 2>/dev/null; then
|
2007-09-24 15:28:48 +00:00
|
|
|
rmdir "${RC_SVCDIR}/.test.$$"
|
2008-06-21 15:31:04 +00:00
|
|
|
for x in ${RC_SVCDIR}/*; do
|
2007-11-23 13:52:15 +00:00
|
|
|
[ -e "${x}" ] || continue
|
|
|
|
case ${x##*/} in
|
2007-12-14 12:17:57 +00:00
|
|
|
depconfig|deptree|ksoftlevel|rc.log);;
|
2007-11-23 13:52:15 +00:00
|
|
|
*) rm -rf "${x}";;
|
|
|
|
esac
|
|
|
|
done
|
2007-04-05 11:18:42 +00:00
|
|
|
else
|
|
|
|
mount_svcdir
|
2008-01-31 09:48:58 +00:00
|
|
|
retval=$?
|
2007-04-05 11:18:42 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "sysinit" > "${RC_SVCDIR}/softlevel"
|
|
|
|
|
|
|
|
# sysinit is now done, so allow init scripts to run normally
|
|
|
|
[ -e /dev/.rcsysinit ] && rm -f /dev/.rcsysinit
|
|
|
|
|
2008-01-31 09:48:58 +00:00
|
|
|
exit ${retval}
|