| 1 |
.\" Man page generated from reStructuredText. |
| 2 |
. |
| 3 |
. |
| 4 |
.nr rst2man-indent-level 0 |
| 5 |
. |
| 6 |
.de1 rstReportMargin |
| 7 |
\\$1 \\n[an-margin] |
| 8 |
level \\n[rst2man-indent-level] |
| 9 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 10 |
- |
| 11 |
\\n[rst2man-indent0] |
| 12 |
\\n[rst2man-indent1] |
| 13 |
\\n[rst2man-indent2] |
| 14 |
.. |
| 15 |
.de1 INDENT |
| 16 |
.\" .rstReportMargin pre: |
| 17 |
. RS \\$1 |
| 18 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 19 |
. nr rst2man-indent-level +1 |
| 20 |
.\" .rstReportMargin post: |
| 21 |
.. |
| 22 |
.de UNINDENT |
| 23 |
. RE |
| 24 |
.\" indent \\n[an-margin] |
| 25 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 26 |
.nr rst2man-indent-level -1 |
| 27 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 28 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 29 |
.. |
| 30 |
.TH "INVOKE-RC.D" "8" "" "1 March 2001" "Debian GNU/Linux" |
| 31 |
.SH NAME |
| 32 |
invoke-rc.d \- executes System-V style init script actions |
| 33 |
.SH SYNOPSIS |
| 34 |
.sp |
| 35 |
\fBinvoke\-rc.d\fP [\fI\-\-quiet\fP] [\fI\-\-force\fP] [\fI\-\-try\-anyway\fP] [\fI\-\-disclose\-deny\fP] |
| 36 |
[\fI\-\-query\fP] [\fI\-\-no\-fallback\fP] \fIname\fP \fIaction\fP [\fIinit script parameters...\fP] |
| 37 |
.sp |
| 38 |
\fBinvoke\-rc.d\fP [\fI\-\-help\fP] |
| 39 |
.SH DESCRIPTION |
| 40 |
.sp |
| 41 |
\fBinvoke\-rc.d\fP |
| 42 |
is a generic interface to execute System V style init script |
| 43 |
\fB/etc/init.d/\fP\fIname\fP |
| 44 |
actions, obeying runlevel constraints as well as any local |
| 45 |
policies set by the system administrator. |
| 46 |
.sp |
| 47 |
All access to the init scripts by Debian packages\(aq maintainer |
| 48 |
scripts should be done through |
| 49 |
\fBinvoke\-rc.d\fP\&. |
| 50 |
.sp |
| 51 |
This manpage documents only the usage and behavior of |
| 52 |
\fBinvoke\-rc.d\fP\&. |
| 53 |
For a discussion of the System V style init script arrangements please |
| 54 |
see \fBinit\fP(8). |
| 55 |
More information on invoke\-rc.d can be found in the section on |
| 56 |
runlevels and init.d scripts of the |
| 57 |
\fIDebian Policy Manual\fP\&. |
| 58 |
.SH INIT SCRIPT ACTIONS |
| 59 |
.sp |
| 60 |
The standard actions are: |
| 61 |
\fIstart\fP, \fIstop\fP, \fIforce\-stop\fP, \fIrestart\fP, \fItry\-restart\fP, \fIreload\fP, |
| 62 |
\fIforce\-reload\fP, and \fIstatus\fP\&. |
| 63 |
Other actions are accepted, but they can cause problems to |
| 64 |
\fBpolicy\-rc.d\fP (see the \fBINIT SCRIPT POLICY\fP section), so |
| 65 |
warnings are generated if the policy layer is active. |
| 66 |
.sp |
| 67 |
Please note that not all init scripts will implement all |
| 68 |
the actions listed above, and that the policy layer may |
| 69 |
override an action to another action(s), or even deny it. |
| 70 |
.sp |
| 71 |
Any extra parameters will be passed to the init script(s) being |
| 72 |
executed. |
| 73 |
.sp |
| 74 |
If an action must be carried out regardless of any local |
| 75 |
policies, use the \fI\-\-force\fP switch. |
| 76 |
.SH OPTIONS |
| 77 |
.INDENT 0.0 |
| 78 |
.TP |
| 79 |
.B \fI\-\-help\fP |
| 80 |
Display usage help. |
| 81 |
.TP |
| 82 |
.B \fI\-\-quiet\fP |
| 83 |
Quiet mode, no error messages are generated. |
| 84 |
.TP |
| 85 |
.B \fI\-\-force\fP |
| 86 |
Tries to run the init script regardless of policy and |
| 87 |
init script subsystem errors. |
| 88 |
\fBUse of this option in Debian maintainer scripts is severely discouraged.\fP |
| 89 |
.TP |
| 90 |
.B \fI\-\-try\-anyway\fP |
| 91 |
Tries to run the init script if a non\-fatal error is |
| 92 |
detected. |
| 93 |
.TP |
| 94 |
.B \fI\-\-disclose\-deny\fP |
| 95 |
Return status code 101 instead of status code 0 if |
| 96 |
the init script action is denied by the policy layer. |
| 97 |
.TP |
| 98 |
.B \fI\-\-query\fP |
| 99 |
Returns one of the status codes 100\-106. Does not |
| 100 |
run the init script, and implies \fI\-\-disclose\-deny\fP |
| 101 |
and \fI\-\-no\-fallback\fP\&. |
| 102 |
.TP |
| 103 |
.B \fI\-\-no\-fallback\fP |
| 104 |
Ignores any fallback action requests by the policy |
| 105 |
layer. |
| 106 |
\fBWarning:\fP |
| 107 |
this is usually a very bad idea for any actions other |
| 108 |
than start. |
| 109 |
.TP |
| 110 |
.B \fI\-\-skip\-systemd\-native\fP |
| 111 |
Exits before doing anything if a systemd environment is detected |
| 112 |
and the requested service is a native systemd unit. |
| 113 |
This is useful for maintainer scripts that want to defer systemd |
| 114 |
actions to \fBdeb\-systemd\-invoke\fP(1p) |
| 115 |
.UNINDENT |
| 116 |
.SH STATUS CODES |
| 117 |
.sp |
| 118 |
Should an init script be executed, \fBinvoke\-rc.d\fP |
| 119 |
always returns the status code |
| 120 |
returned by the init script. Init scripts should not return status codes in |
| 121 |
the 100+ range (which is reserved in Debian and by the LSB). The status codes |
| 122 |
returned by invoke\-rc.d proper are: |
| 123 |
.INDENT 0.0 |
| 124 |
.TP |
| 125 |
.B 0 |
| 126 |
\fISuccess\fP\&. |
| 127 |
Either the init script was run and returned exit status 0 (note |
| 128 |
that a fallback action may have been run instead of the one given in the |
| 129 |
command line), or it was not run because of runlevel/local policy constrains |
| 130 |
and \fB\-\-disclose\-deny\fP is not in effect. |
| 131 |
.TP |
| 132 |
.B 1 \- 99 |
| 133 |
Reserved for init.d script, usually indicates a failure. |
| 134 |
.TP |
| 135 |
.B 100 |
| 136 |
\fBInit script ID (\fP\fIname\fP\fB) unknown.\fP |
| 137 |
This means the init script was not registered successfully through |
| 138 |
\fBupdate\-rc.d\fP or that the init script does not exist. |
| 139 |
.TP |
| 140 |
.B 101 |
| 141 |
\fBAction not allowed\fP\&. |
| 142 |
The requested action will not be performed because of runlevel or local |
| 143 |
policy constraints. |
| 144 |
.TP |
| 145 |
.B 102 |
| 146 |
\fBSubsystem error\fP\&. |
| 147 |
Init script (or policy layer) subsystem malfunction. Also, forced |
| 148 |
init script execution due to \fI\-\-try\-anyway\fP or \fI\-\-force\fP |
| 149 |
failed. |
| 150 |
.TP |
| 151 |
.B 103 |
| 152 |
\fISyntax error.\fP |
| 153 |
.TP |
| 154 |
.B 104 |
| 155 |
\fIAction allowed\fP\&. |
| 156 |
Init script would be run, but \fB\-\-query\fP is in effect. |
| 157 |
.TP |
| 158 |
.B 105 |
| 159 |
\fIBehavior uncertain\fP\&. |
| 160 |
It cannot be determined if action should be carried out or not, and |
| 161 |
\fB\-\-query\fP |
| 162 |
is in effect. |
| 163 |
.TP |
| 164 |
.B 106 |
| 165 |
\fIFallback action requested\fP\&. |
| 166 |
The policy layer denied the requested action, and |
| 167 |
supplied an allowed fallback action to be used instead. |
| 168 |
.UNINDENT |
| 169 |
.SH INIT SCRIPT POLICY |
| 170 |
.sp |
| 171 |
\fBinvoke\-rc.d\fP |
| 172 |
introduces the concept of a policy layer which is used to verify if |
| 173 |
an init script should be run or not, or if something else should be |
| 174 |
done instead. This layer has various uses, the most immediate ones |
| 175 |
being avoiding that package upgrades start daemons out\-of\-runlevel, |
| 176 |
and that a package starts or stops daemons while inside a chroot |
| 177 |
jail. |
| 178 |
.sp |
| 179 |
The policy layer has the following abilities: deny or approve the |
| 180 |
execution of an action; request that another action (called a |
| 181 |
\fIfallback\fP) |
| 182 |
is to be taken, instead of the action requested in invoke\-rc.d\(aqs |
| 183 |
command line; or request multiple actions to be tried in order, until |
| 184 |
one of them succeeds (a multiple \fIfallback\fP). |
| 185 |
.sp |
| 186 |
\fBinvoke\-rc.d\fP |
| 187 |
itself only pays attention to the current runlevel; it will block |
| 188 |
any attempts to start a service in a runlevel in which the service is |
| 189 |
disabled. Other policies are implemented with the use of the |
| 190 |
\fBpolicy\-rc.d\fP |
| 191 |
helper, and are only available if |
| 192 |
\fB/usr/sbin/policy\-rc.d\fP |
| 193 |
is installed in the system. |
| 194 |
.SH FILES |
| 195 |
.INDENT 0.0 |
| 196 |
.TP |
| 197 |
.B /etc/init.d/* |
| 198 |
System V init scripts. |
| 199 |
.TP |
| 200 |
.B /usr/sbin/policy\-rc.d |
| 201 |
Init script policy layer helper (not required). |
| 202 |
.TP |
| 203 |
.B /etc/rc?.d/* |
| 204 |
System V runlevel configuration. |
| 205 |
.UNINDENT |
| 206 |
.SH NOTES |
| 207 |
.sp |
| 208 |
\fBinvoke\-rc.d\fP special cases the \fIstatus\fP |
| 209 |
action, and returns exit status 4 instead of exit status 0 when |
| 210 |
it is denied. |
| 211 |
.SH BUGS |
| 212 |
.sp |
| 213 |
See <http://bugs.debian.org/sysv\-rc> and |
| 214 |
<http://bugs.debian.org/init\-system\-helpers> \&. |
| 215 |
.SH SEE ALSO |
| 216 |
.nf |
| 217 |
\fIDebian Policy manual\fP, |
| 218 |
\fB/etc/init.d/skeleton\fP, |
| 219 |
\fBupdate\-rc.d\fP(8), |
| 220 |
\fBinit\fP(8), |
| 221 |
\fB/usr/share/doc/init\-system\-helpers/README.policy\-rc.d.gz\fP |
| 222 |
.fi |
| 223 |
.sp |
| 224 |
.SH AUTHOR |
| 225 |
Henrique de Moraes Holschuh |
| 226 |
|
| 227 |
License: GNU General Public License v2 or Later (GPLv2+) |
| 228 |
.SH COPYRIGHT |
| 229 |
2001 Henrique de Moraes Holschuh |
| 230 |
.\" Generated by docutils manpage writer. |
| 231 |
. |