openrc/sh/init-common-post.sh.in

26 lines
680 B
Bash
Raw Normal View History

# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
# mount $RC_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
: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
: ${RC_SVCDIR:=@LIBEXECDIR@/init.d}
case "$(openrc --sys)" in
2009-04-27 02:43:26 +05:30
OPENVZ|VSERVER) rm -rf "$RC_SVCDIR"/*;;
*) if mountinfo --quiet "$RC_SVCDIR"; then
rm -rf "$RC_SVCDIR"/*
else
mount_svcdir
fi
;;
esac
retval=$?
if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then
cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
fi
2009-04-27 02:43:26 +05:30
echo sysinit >"$RC_SVCDIR"/softlevel
exit $retval