-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinvoke-rc.d.8
219 lines (207 loc) · 5.51 KB
/
invoke-rc.d.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Henrique Holschuh, Roland Rosenfeld
.TH INVOKE\-RC.D 8 "March 2004" "Debian Project" "Debian/GNU Linux"
.SH NAME
invoke\-rc.d \- executes System-V style init script actions
.SH SYNOPSIS
.B invoke\-rc.d
.RI [ --quiet ]
.RI [ --force ]
.RI [ --try-anyway ]
.RI [ --disclose-deny ]
.RI [ --query ]
.RI [ --no-fallback ]
.I name
.I action
.RI [ init\ script\ parameters... ]
.HP
.B invoke\-rc.d
.RI [ --help ]
.HP
.SH DESCRIPTION
.B invoke\-rc.d
is a generic interface to execute System V style init script
.BI /etc/init.d/ name \fR
actions, obeying runlevel constraints as well as any local
policies set by the system administrator.
All access to the init scripts by Debian packages' maintainer
scripts should be done through
.B invoke\-rc.d\fR.
This manpage documents only the usage and behavior of
.BR invoke\-rc.d .
For a discussion of the System V style init script arrangements please
see
.BR init (8)
and the
.IR "dpkg programmers' manual" .
More information on invoke-rc.d can be found in the section on
runlevels and init.d scripts of the
.IR "debian policy manual" .
.SH INIT SCRIPT ACTIONS
The standard actions are:
.IR start ,
.IR stop ,
.IR force\-stop ,
.IR restart ,
.IR reload ,
.IR force\-reload ,
and
.IR status .
Other actions are accepted, but they can cause problems to
.B policy\-rc.d
(see the
.B INIT SCRIPT POLICY
section), so warnings are generated if the policy layer
is active.
Please note that not all init scripts will implement all
the actions listed above, and that the policy layer may
override an action to another action(s), or even deny it.
Any extra init script parameters will be passed to the
init script(s) being executed.
If an action must be carried out regardless of any local
policies, use the
.IR --force
switch.
.SH OPTIONS
.TP
.I --help
Display usage help.
.TP
.I --quiet
Quiet mode, no error messages are generated.
.TP
.I --force
Tries to run the init script regardless of policy and
init script subsystem errors.
.B Use of this option in Debian maintainer scripts is severely discouraged.
.TP
.I --try-anyway
Tries to run the init script if a non-fatal error is
detected.
.TP
.I --disclose-deny
Return status code 101 instead of status code 0 if
the init script action is denied by the policy layer.
.TP
.I --query
Returns one of the status codes 100-106. Does not
run the init script, and implies
.IR --disclose-deny
and
.IR --no-fallback .
.TP
.I --no-fallback
Ignores any fallback action requests by the policy
layer.
.B Warning:
this is usually a very bad idea for any actions other
than
.RI start .
.SH STATUS CODES
Should an init script be executed,
.B invoke\-rc.d
always returns the status code
returned by the init script. Init scripts should not return status codes in
the 100+ range (which is reserved in Debian and by the LSB). The status codes
returned by invoke\-rc.d proper are:
.TP
0
.IR 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
.B --disclose-deny
is not in effect.
.TP
1 - 99
Reserved for init.d script, usually indicates a failure.
.TP
100
.B Init script ID
.BI ( name )
.BR unknown .
This means the init script was not registered successfully through
.B update\-rc.d
or that the init script does not exist.
.TP
101
.B Action not allowed\fR.
The requested action will not be performed because of runlevel or local
policy constraints.
.TP
102
.B Subsystem error\fR.
Init script (or policy layer) subsystem malfunction. Also, forced
init script execution due to
.I --try-anyway
or
.I --force
failed\fR.
.TP
103
.I Syntax error\fR.
.TP
104
.I Action allowed\fR.
Init script would be run, but
.B --query
is in effect.
.TP
105
.I Behavior uncertain\fR.
It cannot be determined if action should be carried out or not, and
.B --query
is in effect.
.TP
106
.I Fallback action requested\fR.
The policy layer denied the requested action, and
supplied an allowed fallback action to be used instead.
.SH INIT SCRIPT POLICY
.B 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.
The policy layer has the following abilities: deny or approve the
execution of an action; request that another action (called a
.IR fallback )
is to be taken, instead of the action requested in invoke\-rc.d's
command line; or request multiple actions to be tried in order, until
one of them succeeds (a multiple
.IR fallback ).
.B invoke\-rc.d
itself will only pay attention to the current runlevel, and block
any tries to start an init script in a runlevel it is not configured
to be started at. Other policies are implemented with the use of
the
.B policy\-rc.d
helper, and are only available if
.B /usr/sbin/policy\-rc.d
is installed in the system.
.SH FILES
.TP
.BR /etc/init.d/*
System V init scripts.
.TP
.BR /usr/sbin/policy\-rc.d
Init script policy layer helper (not required).
.TP
.BR /etc/runlevel.conf
file-rc runlevel configuration.
.SH BUGS
Please report any bugs using the Debian bug tracking system,
http://bugs.debian.org/file\-rc.
.SH SEE ALSO
.IR "dpkg programmers manual" ,
.br
.BR /etc/init.d/skeleton ,
.br
.BR update\-rc.d (8),
.br
.BR init (8),
.br
.BR /usr/share/doc/file-rc/README.policy-rc.d.gz