invoke-rc.d

executes System-V style init script actions

invoke-rc.d [--quiet] [--force] [--try-anyway] [--disclose-deny] [--query] [--no-fallback] name action [init script parameters] executes System V style init script /etc/init.d/name actions, obeying runlevel constraints as well as any local policies

access to the init scripts should be done through invoke-rc.d.

For init scripts see init(8).

INIT SCRIPT ACTIONS

start, stop, force-stop, restart, try-restart, reload, force-reload, and status. Other actions are accepted, but they can cause problems to policy-rc.d (see the INIT SCRIPT POLICY section), so warnings are generated if the policy layer is active. Extra parameters will be passed to the script(s)
--help Display usage help.
--quiet Quiet mode, no error messages are generated.
--force avoid runs the script regardless of policy and subsystem errors
--try-anyway runs the script if a non-fatal error is detected.
--disclose-deny Return status 101 instead of 0 if the action is denied by the policy layer.
--query Returns status codes 100..106.
Does not run the init script, and implies --disclose-deny and --no-fallback.
--no-fallback Ignores fallback action requests by the policy layer. bad other than start.

STATUS CODES

0 Success. Either the init script was run and returned exit status 0 (note that a fallback action may have been run instead of the one given in the command line), or it was not run because of runlevel/local policy constrains and --disclose-deny is not in effect.
100 ID (name) unknown. script was not registered successfully through update-rc.d or that the init script does not exist.
101 not allowed because of runlevel or local policy constraints.
102 Subsystem error. script (or policy layer) subsystem malfunction. Also, forced init script execution due to --try-anyway or --force failed.
103 Syntax error.
104 Action allowed. --query is in effect.
105 Behavior uncertain. cannot be determined if action should be carried out and --query is in effect.
106 Fallback requested. policy layer denied the requested action, and supplied an allowed fallback action to be used instead.

INIT SCRIPT POLICY

invoke-rc.d introduces the concept of a policy layer which is used to verify if an init script should be run or not, or if something else should be done instead.
This layer has various uses, the most immediate ones being avoiding that package upgrades start daemons out-of-runlevel, and that a package starts or stops daemons while inside a chroot jail.o

The policy layer has the abilities:

invoke-rc.d only pays attention to the current runlevel; it will block any attempts to start a service in a runlevel in which the service is disabled. Other policies are implemented with the use of the policy-rc.d helper, and are only available if /usr/sbin/policy-rc.d is installed in the system.

FILES

System V init scripts. /etc/init.d/*
Init script policy layer helper (not required). /usr/sbin/policy-rc.d
file-rc runlevel configuration (if the file-rc package is being used). /etc/runlevel.conf
System V runlevel configuration (if the sysv-rc package is being used). /etc/rc?.d/*
invoke-rc.d special cases the status action, and returns exit status 4 instead of exit status 0 when it is denied. SEE ALSO /etc/init.d/skeleton, update-rc.d(8), init(8), /usr/share/doc/init-system-helpers/README.policy-rc.d.gz