openrc/sh/init-common-post.sh.in
William Hubbs 7b5fa011ac Rename the rc binary to openrc
Debian requested this rename due to the "rc" binary conflicting with the
"rc" binary from the plan 9 shell.

We also add a deprecation warning to the binary when it is run as rc to
encourage users to switch to openrc instead.

X-Gentoo-Bug: 493958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493958
2013-12-12 18:31:29 -06:00

26 lines
680 B
Bash

# 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
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
echo sysinit >"$RC_SVCDIR"/softlevel
exit $retval