2009-05-23 20:38:12 +01:00
|
|
|
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
2011-06-29 19:46:31 -04:00
|
|
|
# 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
|
2009-05-23 20:38:12 +01:00
|
|
|
: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
|
|
|
|
: ${RC_SVCDIR:=@LIBEXECDIR@/init.d}
|
2009-01-29 13:38:15 +00:00
|
|
|
case "$(rc --sys)" in
|
2009-04-26 21:13:26 +00:00
|
|
|
OPENVZ|VSERVER) rm -rf "$RC_SVCDIR"/*;;
|
|
|
|
*) if mountinfo --quiet "$RC_SVCDIR"; then
|
|
|
|
rm -rf "$RC_SVCDIR"/*
|
2009-01-29 13:38:15 +00:00
|
|
|
else
|
|
|
|
mount_svcdir
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
retval=$?
|
2007-04-05 11:18:42 +00:00
|
|
|
|
2009-05-23 20:38:12 +01:00
|
|
|
if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then
|
|
|
|
cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
|
2008-11-03 15:31:01 +00:00
|
|
|
fi
|
|
|
|
|
2009-04-26 21:13:26 +00:00
|
|
|
echo sysinit >"$RC_SVCDIR"/softlevel
|
|
|
|
exit $retval
|