version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
START-STOP-DAEMON |
|
|
2 |
!!!START-STOP-DAEMON |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
AUTHORS |
|
|
8 |
---- |
|
|
9 |
!!NAME |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
start-stop-daemon - start and stop system daemon programs |
|
|
13 |
!!SYNOPSIS |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
__start-stop-daemon -S__|__--start__ ''options'' |
|
|
17 |
[[__--__] ''arguments'' |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__start-stop-daemon -K__|__--stop__ |
|
|
21 |
''options'' |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__start-stop-daemon -H__|__--help__ |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
__start-stop-daemon -V__|__--version__ |
|
|
28 |
!!DESCRIPTION |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
__start-stop-daemon__ is used to control the creation and |
|
|
32 |
termination of system-level processes. Using the |
|
|
33 |
__--exec__, __--pidfile__, __--user__, and |
|
|
34 |
__--name__ options, __start-stop-daemon__ can be |
|
|
35 |
configured to find existing instances of a running |
|
|
36 |
process. |
|
|
37 |
|
|
|
38 |
|
|
|
39 |
With __--start__, __start-stop-daemon__ checks for the |
|
|
40 |
existence of a specified process. If such a process exists, |
|
|
41 |
__start-stop-daemon__ does nothing, and exits with error |
|
|
42 |
status 1 (0 if __--oknodo__ is specified). If such a |
|
|
43 |
process does not exist, it starts an instance, using either |
|
|
44 |
the executable specified by __--exec__, (or, if |
|
|
45 |
specified, by __--startas__). Any arguments given after |
|
|
46 |
__--__ on the command line are passed unmodified to the |
|
|
47 |
program being started. If __--retry__ is specified then |
|
|
48 |
start-stop-daemon will check that the process(es) have |
|
|
49 |
terminated. |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
With __--stop__, __start-stop-daemon__ also checks for |
|
|
53 |
the existence of a specified process. If such a process |
|
|
54 |
exists, __start-stop-daemon__ sends it the signal |
|
|
55 |
specified by __--signal__, and exits with error status 0. |
|
|
56 |
If such a process does not exist, __start-stop-daemon__ |
|
|
57 |
exits with error status 1 (0 if __--oknodo__ is |
|
|
58 |
specified). |
|
|
59 |
!!OPTIONS |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
__-x__|__--exec__ ''executable'' |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
Check for processes that are instances of this executable |
|
|
66 |
(according to __/proc/__ ''pid'' __/exe__ |
|
|
67 |
). |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
__-p__|__--pidfile__ ''pid-file'' |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
Check for processes whose process-id is specified in |
|
|
74 |
''pid-file.'' |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
__-u__|__--user__ |
|
|
78 |
''username''|''uid'' |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
Check for processes owned by the user specified by |
|
|
82 |
''username'' or ''uid.'' |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
__-n__|__--name__ ''process-name'' |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Check for processes with the name ''process-name'' |
|
|
89 |
(according to __/proc/__ ''pid'' __/stat__ |
|
|
90 |
). |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
__-s__|__--signal__ ''signal'' |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
With __--stop__ , specifies the signal to send to |
|
|
97 |
processes being stopped (default 15). |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
__-R__|__--retry__ |
|
|
101 |
''timeout''|''schedule'' |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
With __--stop__, specifies that __start-stop-daemon__ |
|
|
105 |
is to check whether the process(es) do finish. It will check |
|
|
106 |
repeatedly whether any matching processes are running, until |
|
|
107 |
none are. If the processes do not exit it will then take |
|
|
108 |
further action as determined by the schedule. |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
If ''timeout'' is specified instead of ''schedule'' |
|
|
112 |
then the schedule |
|
|
113 |
''signal''__/__''timeout''__/KILL/__''timeout'' |
|
|
114 |
is used, where ''signal'' is the signal specified with |
|
|
115 |
__--signal__. |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
''schedule'' is a list of at least two items separated by |
|
|
119 |
slashes (__/__); each item may be |
|
|
120 |
__-__''signal-number'' or |
|
|
121 |
[[__-__]''signal-name'', which means to send that |
|
|
122 |
signal, or ''timeout'', which means to wait that many |
|
|
123 |
seconds for processes to exit, or __forever__, which |
|
|
124 |
means to repeat the rest of the schedule forever if |
|
|
125 |
necessary. |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
If the end of the schedule is reached and __forever__ is |
|
|
129 |
not specified, then __start-stop-daemon__ exits with |
|
|
130 |
error status 2. If a schedule is specified, then any signal |
|
|
131 |
specified with __--signal__ is ignored. |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
__-a__|__--startas__ ''pathname'' |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
With __--start__, start the process specified by |
|
|
138 |
''pathname''. If not specified, defaults to the argument |
|
|
139 |
given to __--exec__. |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
__-t__|__--test__ |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
Print actions that would be taken and set appropriate return |
|
|
146 |
value, but take no action. |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
__-o__|__--oknodo__ |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
Return exit status 0 instead of 1 if no actions are (would |
|
|
153 |
be) taken. |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
__-q__|__--quiet__ |
|
|
157 |
|
|
|
158 |
|
|
|
159 |
Do not print informational messages; only display error |
|
|
160 |
messages. |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
__-c__|__--chuid__ |
|
|
164 |
''username''|''uid'' |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
Change to this username/uid before starting the process. You |
|
|
168 |
can also specify a group by appending a __:__, then the |
|
|
169 |
group or gid in the same way as you would for the `chown' |
|
|
170 |
command (''user''__:__''group''). When using this |
|
|
171 |
option you must realize that the primary and supplemental |
|
|
172 |
groups are set as well, even if the __--group__ option is |
|
|
173 |
not specified. The __--group__ option is only for groups |
|
|
174 |
that the user isn't normally a member of (like adding |
|
|
175 |
per/process group membership for generic users like |
|
|
176 |
__nobody__). |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__-r__|__--chroot__ ''root'' |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
Chdir and chroot to ''root'' before starting the process. |
|
|
183 |
Please note that the pidfile is also written after the |
|
|
184 |
chroot. |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
__-b__|__--background__ |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
Typically used with programs that don't detach on their own. |
|
|
191 |
This option will force __start-stop-daemon__ to fork |
|
|
192 |
before starting the process, and force it into the |
|
|
193 |
background. __WARNING: start-stop-daemon__ cannot check |
|
|
194 |
the exit status if the process fails to execute for |
|
|
195 |
__any__ reason. This is a last resort, and is only meant |
|
|
196 |
for programs that either make no sense forking on their own, |
|
|
197 |
or where it's not feasible to add the code for it to do this |
|
|
198 |
itself. |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
__-N__|__--nicelevel__ |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
This alters the prority of the process before starting |
|
|
205 |
it. |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
__-m__|__--make-pidfile__ |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
Used when starting a program that does not create its own |
|
|
212 |
pid file. This option will make __start-stop-daemon__ |
|
|
213 |
create the file referenced with __--pidfile__ and place |
|
|
214 |
the pid into it just before executing the process. Note, it |
|
|
215 |
will not be removed when stopping the program. __NOTE:__ |
|
|
216 |
This feature may not work in all cases. Most notably when |
|
|
217 |
the program being executed forks from its main process. |
|
|
218 |
Because of this it is usually only useful when combined with |
|
|
219 |
the __--background__ option. |
|
|
220 |
|
|
|
221 |
|
|
|
222 |
__-v__|__--verbose__ |
|
|
223 |
|
|
|
224 |
|
|
|
225 |
Print verbose informational messages. |
|
|
226 |
|
|
|
227 |
|
|
|
228 |
__-H__|__--help__ |
|
|
229 |
|
|
|
230 |
|
|
|
231 |
Print help information; then exit. |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
__-V__|__--version__ |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
Print version information; then exit. |
|
|
238 |
!!AUTHORS |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
Marek Michalkiewicz |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
Manual page by Klee Dienes |
|
|
245 |
---- |