2 # Filename: policy-rc.d
3 # Purpose: interface script for invoke-rc.d (see /etc/policy-rc.d.conf)
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
10 # make sure /proc/1/root can be read, if not either /proc is not mounted
11 # or it is not executed with root permissions (and "sudo invoke-rc.d $service"
12 # might fail), if so don't continue
13 if [ -d /proc/1 ] && readlink -f /proc/1/root >/dev/null 2>&1; then
14 if test "$(/usr/bin/stat -c "%d/%i" /)" != "$(/usr/bin/stat -Lc "%d/%i" /proc/1/root 2>/dev/null)" ; then
15 # notify invoke-rc.d that nothing should be done -- we are in a chroot
20 # read configuration file
21 if [ -z "$POLICYRCD" ] ; then
22 if [ -r /etc/policy-rc.d.conf ] ; then
23 . /etc/policy-rc.d.conf
27 if [ -z "$POLICYRCD" ]; then
28 for file in /usr/local/sbin/policy-rc.d /etc/policy-rc.d; do
29 if [ -x "$file" ]; then
36 # if $POLICYRCD is set or either /usr/local/sbin/policy-rc.d
37 # or /etc/policy-rc.d are present execute them:
38 if [ -n "$POLICYRCD" ]; then
42 # otherwise exit with $EXITSTATUS,
43 # being '0' by default
44 if [ -n "$EXITSTATUS" ]; then
47 # or if $EXITSTATUS isn't set just allow it
52 ## END OF FILE #################################################################