Merge lp:~jamesodhunt/upstart/upstream-socket-bridge into lp:upstart
- upstream-socket-bridge
- Merge into trunk
Proposed by
James Hunt
Status: | Merged |
---|---|
Merged at revision: | 1307 |
Proposed branch: | lp:~jamesodhunt/upstart/upstream-socket-bridge |
Merge into: | lp:upstart |
Diff against target: |
2186 lines (+1594/-97) 22 files modified
.bzrignore (+4/-0) Makefile.am (+1/-1) configure.ac (+5/-2) dbus/com.ubuntu.Upstart.xml (+7/-0) extra/Makefile.am (+113/-0) extra/conf/upstart-socket-bridge.conf (+16/-0) extra/conf/upstart-udev-bridge.conf (+14/-0) extra/man/socket-event.7 (+92/-0) extra/man/upstart-socket-bridge.8 (+47/-0) extra/man/upstart-udev-bridge.8 (+35/-0) extra/upstart-socket-bridge.c (+644/-0) extra/upstart-udev-bridge.c (+310/-0) init/control.c (+38/-9) init/control.h (+4/-0) init/event.c (+13/-0) init/event.h (+1/-0) init/event_operator.c (+59/-0) init/event_operator.h (+8/-0) init/job.c (+3/-0) init/job.h (+3/-0) po/POTFILES.in (+2/-0) po/upstart.pot (+175/-85) |
To merge this branch: | bzr merge lp:~jamesodhunt/upstart/upstream-socket-bridge |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Upstart Developers | Pending | ||
Review via email: mp+61036@code.launchpad.net |
Commit message
Description of the change
Minor fixes and documentation for upstart-
* extra/Makefile.am: Added socket-bridge.conf and manual pages
to distribution.
* extra/upstart-
part of the Socket object was being initialized).
* New files:
- extra/conf/
socket bridge.
- extra/man/
to collision with existing socket(7) page.
- extra/man/
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2010-12-10 04:03:25 +0000 | |||
3 | +++ .bzrignore 2011-05-15 18:31:10 +0000 | |||
4 | @@ -59,3 +59,7 @@ | |||
5 | 59 | util/shutdown | 59 | util/shutdown |
6 | 60 | util/telinit | 60 | util/telinit |
7 | 61 | util/test_* | 61 | util/test_* |
8 | 62 | extra/com.ubuntu.Upstart.[ch] | ||
9 | 63 | extra/com.ubuntu.Upstart.Job.[ch] | ||
10 | 64 | extra/upstart-socket-bridge | ||
11 | 65 | extra/upstart-udev-bridge | ||
12 | 62 | 66 | ||
13 | === modified file 'Makefile.am' | |||
14 | --- Makefile.am 2010-02-04 03:42:29 +0000 | |||
15 | +++ Makefile.am 2011-05-15 18:31:10 +0000 | |||
16 | @@ -1,6 +1,6 @@ | |||
17 | 1 | ## Process this file with automake to produce Makefile.in | 1 | ## Process this file with automake to produce Makefile.in |
18 | 2 | 2 | ||
20 | 3 | SUBDIRS = intl dbus init util conf doc contrib po | 3 | SUBDIRS = intl dbus init util extra conf doc contrib po |
21 | 4 | 4 | ||
22 | 5 | EXTRA_DIST = HACKING | 5 | EXTRA_DIST = HACKING |
23 | 6 | 6 | ||
24 | 7 | 7 | ||
25 | === modified file 'configure.ac' | |||
26 | --- configure.ac 2011-03-22 17:53:17 +0000 | |||
27 | +++ configure.ac 2011-05-15 18:31:10 +0000 | |||
28 | @@ -30,6 +30,9 @@ | |||
29 | 30 | PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2]) | 30 | PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2]) |
30 | 31 | PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) | 31 | PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) |
31 | 32 | PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) | 32 | PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) |
32 | 33 | PKG_CHECK_MODULES([UDEV], [libudev >= 146], [have_udev=yes], [have_udev=no]) | ||
33 | 34 | |||
34 | 35 | AM_CONDITIONAL([HAVE_UDEV], [test "$have_udev" = yes]) | ||
35 | 33 | 36 | ||
36 | 34 | # Checks for header files. | 37 | # Checks for header files. |
37 | 35 | AC_CHECK_HEADERS([valgrind/valgrind.h]) | 38 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
38 | @@ -63,7 +66,7 @@ | |||
39 | 63 | 66 | ||
40 | 64 | 67 | ||
41 | 65 | AC_CONFIG_FILES([ Makefile intl/Makefile | 68 | AC_CONFIG_FILES([ Makefile intl/Makefile |
44 | 66 | dbus/Makefile init/Makefile util/Makefile conf/Makefile | 69 | dbus/Makefile init/Makefile util/Makefile extra/Makefile |
45 | 67 | doc/Makefile contrib/Makefile po/Makefile.in ]) | 70 | conf/Makefile doc/Makefile contrib/Makefile po/Makefile.in ]) |
46 | 68 | AC_CONFIG_HEADERS([config.h]) | 71 | AC_CONFIG_HEADERS([config.h]) |
47 | 69 | AC_OUTPUT | 72 | AC_OUTPUT |
48 | 70 | 73 | ||
49 | === modified file 'dbus/com.ubuntu.Upstart.xml' | |||
50 | --- dbus/com.ubuntu.Upstart.xml 2009-07-03 16:08:10 +0000 | |||
51 | +++ dbus/com.ubuntu.Upstart.xml 2011-05-15 18:31:10 +0000 | |||
52 | @@ -49,6 +49,13 @@ | |||
53 | 49 | <arg name="env" type="as" direction="in" /> | 49 | <arg name="env" type="as" direction="in" /> |
54 | 50 | <arg name="wait" type="b" direction="in" /> | 50 | <arg name="wait" type="b" direction="in" /> |
55 | 51 | </method> | 51 | </method> |
56 | 52 | <method name="EmitEventWithFile"> | ||
57 | 53 | <annotation name="com.netsplit.Nih.Method.Async" value="true" /> | ||
58 | 54 | <arg name="name" type="s" direction="in" /> | ||
59 | 55 | <arg name="env" type="as" direction="in" /> | ||
60 | 56 | <arg name="wait" type="b" direction="in" /> | ||
61 | 57 | <arg name="file" type="h" direction="in" /> | ||
62 | 58 | </method> | ||
63 | 52 | 59 | ||
64 | 53 | <!-- Basic information about Upstart --> | 60 | <!-- Basic information about Upstart --> |
65 | 54 | <property name="version" type="s" access="read" /> | 61 | <property name="version" type="s" access="read" /> |
66 | 55 | 62 | ||
67 | === added directory 'extra' | |||
68 | === added file 'extra/Makefile.am' | |||
69 | --- extra/Makefile.am 1970-01-01 00:00:00 +0000 | |||
70 | +++ extra/Makefile.am 2011-05-15 18:31:10 +0000 | |||
71 | @@ -0,0 +1,113 @@ | |||
72 | 1 | ## Process this file with automake to produce Makefile.in | ||
73 | 2 | |||
74 | 3 | AM_CFLAGS = \ | ||
75 | 4 | $(NIH_CFLAGS) \ | ||
76 | 5 | $(NIH_DBUS_CFLAGS) \ | ||
77 | 6 | $(DBUS_CFLAGS) \ | ||
78 | 7 | $(UDEV_CFLAGS) | ||
79 | 8 | |||
80 | 9 | AM_CPPFLAGS = \ | ||
81 | 10 | -DLOCALEDIR="\"$(localedir)\"" \ | ||
82 | 11 | -DSBINDIR="\"$(sbindir)\"" \ | ||
83 | 12 | -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ | ||
84 | 13 | -I$(top_srcdir)/intl | ||
85 | 14 | |||
86 | 15 | |||
87 | 16 | initdir = $(sysconfdir)/init | ||
88 | 17 | |||
89 | 18 | |||
90 | 19 | sbin_PROGRAMS = \ | ||
91 | 20 | upstart-socket-bridge | ||
92 | 21 | |||
93 | 22 | dist_init_DATA = \ | ||
94 | 23 | conf/upstart-socket-bridge.conf | ||
95 | 24 | |||
96 | 25 | dist_man_MANS = \ | ||
97 | 26 | man/upstart-socket-bridge.8 \ | ||
98 | 27 | man/socket-event.7 | ||
99 | 28 | |||
100 | 29 | upstart_socket_bridge_SOURCES = \ | ||
101 | 30 | upstart-socket-bridge.c | ||
102 | 31 | nodist_upstart_socket_bridge_SOURCES = \ | ||
103 | 32 | $(com_ubuntu_Upstart_OUTPUTS) \ | ||
104 | 33 | $(com_ubuntu_Upstart_Job_OUTPUTS) | ||
105 | 34 | upstart_socket_bridge_LDADD = \ | ||
106 | 35 | $(LTLIBINTL) \ | ||
107 | 36 | $(NIH_LIBS) \ | ||
108 | 37 | $(NIH_DBUS_LIBS) \ | ||
109 | 38 | $(DBUS_LIBS) | ||
110 | 39 | |||
111 | 40 | |||
112 | 41 | if HAVE_UDEV | ||
113 | 42 | dist_init_DATA += \ | ||
114 | 43 | conf/upstart-udev-bridge.conf | ||
115 | 44 | |||
116 | 45 | dist_man_MANS += \ | ||
117 | 46 | man/upstart-udev-bridge.8 | ||
118 | 47 | |||
119 | 48 | |||
120 | 49 | sbin_PROGRAMS += \ | ||
121 | 50 | upstart-udev-bridge | ||
122 | 51 | |||
123 | 52 | upstart_udev_bridge_SOURCES = \ | ||
124 | 53 | upstart-udev-bridge.c | ||
125 | 54 | nodist_upstart_udev_bridge_SOURCES = \ | ||
126 | 55 | $(com_ubuntu_Upstart_OUTPUTS) | ||
127 | 56 | upstart_udev_bridge_LDADD = \ | ||
128 | 57 | $(LTLIBINTL) \ | ||
129 | 58 | $(NIH_LIBS) \ | ||
130 | 59 | $(NIH_DBUS_LIBS) \ | ||
131 | 60 | $(DBUS_LIBS) \ | ||
132 | 61 | $(UDEV_LIBS) | ||
133 | 62 | else | ||
134 | 63 | EXTRA_DIST = \ | ||
135 | 64 | man/upstart-udev-bridge.8 | ||
136 | 65 | endif | ||
137 | 66 | |||
138 | 67 | |||
139 | 68 | com_ubuntu_Upstart_OUTPUTS = \ | ||
140 | 69 | com.ubuntu.Upstart.c \ | ||
141 | 70 | com.ubuntu.Upstart.h | ||
142 | 71 | |||
143 | 72 | com_ubuntu_Upstart_XML = \ | ||
144 | 73 | ../dbus/com.ubuntu.Upstart.xml | ||
145 | 74 | |||
146 | 75 | $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) | ||
147 | 76 | $(AM_V_GEN)$(NIH_DBUS_TOOL) \ | ||
148 | 77 | --package=$(PACKAGE) \ | ||
149 | 78 | --mode=proxy --prefix=upstart \ | ||
150 | 79 | --default-interface=com.ubuntu.Upstart0_6 \ | ||
151 | 80 | --output=$@ $< | ||
152 | 81 | |||
153 | 82 | |||
154 | 83 | com_ubuntu_Upstart_Job_OUTPUTS = \ | ||
155 | 84 | com.ubuntu.Upstart.Job.c \ | ||
156 | 85 | com.ubuntu.Upstart.Job.h | ||
157 | 86 | |||
158 | 87 | com_ubuntu_Upstart_Job_XML = \ | ||
159 | 88 | ../dbus/com.ubuntu.Upstart.Job.xml | ||
160 | 89 | |||
161 | 90 | $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) | ||
162 | 91 | $(AM_V_GEN)$(NIH_DBUS_TOOL) \ | ||
163 | 92 | --package=$(PACKAGE) \ | ||
164 | 93 | --mode=proxy --prefix=job_class \ | ||
165 | 94 | --default-interface=com.ubuntu.Upstart0_6.Job \ | ||
166 | 95 | --output=$@ $< | ||
167 | 96 | |||
168 | 97 | |||
169 | 98 | # These have to be built sources because we can't compile object files | ||
170 | 99 | # without the header file existing first | ||
171 | 100 | BUILT_SOURCES = \ | ||
172 | 101 | $(com_ubuntu_Upstart_OUTPUTS) \ | ||
173 | 102 | $(com_ubuntu_Upstart_Job_OUTPUTS) | ||
174 | 103 | |||
175 | 104 | CLEANFILES = \ | ||
176 | 105 | $(com_ubuntu_Upstart_OUTPUTS) \ | ||
177 | 106 | $(com_ubuntu_Upstart_Job_OUTPUTS) | ||
178 | 107 | |||
179 | 108 | |||
180 | 109 | clean-local: | ||
181 | 110 | rm -f *.gcno *.gcda | ||
182 | 111 | |||
183 | 112 | maintainer-clean-local: | ||
184 | 113 | rm -f *.gcov | ||
185 | 0 | 114 | ||
186 | === added directory 'extra/conf' | |||
187 | === added file 'extra/conf/upstart-socket-bridge.conf' | |||
188 | --- extra/conf/upstart-socket-bridge.conf 1970-01-01 00:00:00 +0000 | |||
189 | +++ extra/conf/upstart-socket-bridge.conf 2011-05-15 18:31:10 +0000 | |||
190 | @@ -0,0 +1,16 @@ | |||
191 | 1 | # upstart-socket-bridge - Bridge socket events into upstart | ||
192 | 2 | # | ||
193 | 3 | # This helper daemon receives socket(7) events and | ||
194 | 4 | # emits equivalent Upstart events. | ||
195 | 5 | |||
196 | 6 | description "Bridge socket events into upstart" | ||
197 | 7 | |||
198 | 8 | emits socket | ||
199 | 9 | |||
200 | 10 | start on net-device-up IFACE=lo | ||
201 | 11 | stop on runlevel [!2345] | ||
202 | 12 | |||
203 | 13 | expect daemon | ||
204 | 14 | respawn | ||
205 | 15 | |||
206 | 16 | exec upstart-socket-bridge --daemon | ||
207 | 0 | 17 | ||
208 | === added file 'extra/conf/upstart-udev-bridge.conf' | |||
209 | --- extra/conf/upstart-udev-bridge.conf 1970-01-01 00:00:00 +0000 | |||
210 | +++ extra/conf/upstart-udev-bridge.conf 2011-05-15 18:31:10 +0000 | |||
211 | @@ -0,0 +1,14 @@ | |||
212 | 1 | # upstart-udev-bridge - Bridge udev events into upstart | ||
213 | 2 | # | ||
214 | 3 | # This helper daemon receives udev events from the netlink socket and | ||
215 | 4 | # emits equivalent Upstart events. | ||
216 | 5 | |||
217 | 6 | description "Bridge udev events into upstart" | ||
218 | 7 | |||
219 | 8 | start on starting udev | ||
220 | 9 | stop on stopped udev | ||
221 | 10 | |||
222 | 11 | expect daemon | ||
223 | 12 | respawn | ||
224 | 13 | |||
225 | 14 | exec upstart-udev-bridge --daemon | ||
226 | 0 | 15 | ||
227 | === added directory 'extra/man' | |||
228 | === added file 'extra/man/socket-event.7' | |||
229 | --- extra/man/socket-event.7 1970-01-01 00:00:00 +0000 | |||
230 | +++ extra/man/socket-event.7 2011-05-15 18:31:10 +0000 | |||
231 | @@ -0,0 +1,92 @@ | |||
232 | 1 | .TH socket\-event 8 2011-03-08 upstart | ||
233 | 2 | .\" | ||
234 | 3 | .SH NAME | ||
235 | 4 | socket \- event signalling that a socket connection has been made | ||
236 | 5 | .\" | ||
237 | 6 | .SH SYNOPSIS | ||
238 | 7 | .B socket | ||
239 | 8 | .BI PROTO\fR= PROTO | ||
240 | 9 | .BI PORT\fR= PORT | ||
241 | 10 | .BI ADDR\fR= ADDR | ||
242 | 11 | |||
243 | 12 | .B socket | ||
244 | 13 | .BI PROTO\fR= PROTO | ||
245 | 14 | .BI PATH\fR= PATH | ||
246 | 15 | .\" | ||
247 | 16 | .SH DESCRIPTION | ||
248 | 17 | |||
249 | 18 | The | ||
250 | 19 | .B socket | ||
251 | 20 | event is generated by the | ||
252 | 21 | .BR upstart\-socket\-bridge (8) | ||
253 | 22 | daemon when a socket connection is made whose details match the | ||
254 | 23 | socket event condition and environment specified in a jobs | ||
255 | 24 | .B start on | ||
256 | 25 | or | ||
257 | 26 | .B stop on | ||
258 | 27 | stanza. | ||
259 | 28 | |||
260 | 29 | When an incoming connection is detected, the file descriptor | ||
261 | 30 | representing the socket is passed to the job in question to allow it to | ||
262 | 31 | .BR accept (2) | ||
263 | 32 | the connection. Additionally, the environment variable | ||
264 | 33 | .B UPSTART_JOB | ||
265 | 34 | will contain the name of the event ("socket") and the environment | ||
266 | 35 | variable | ||
267 | 36 | .B UPSTART_FDS | ||
268 | 37 | will contain the number of the file descriptor corresponding to the | ||
269 | 38 | listening socket. | ||
270 | 39 | .\" | ||
271 | 40 | .SH EXAMPLES | ||
272 | 41 | .\" | ||
273 | 42 | .SS Internet socket | ||
274 | 43 | Start web server when first client connects from localhost: | ||
275 | 44 | .RS | ||
276 | 45 | .nf | ||
277 | 46 | |||
278 | 47 | start on socket PROTO=inet PORT=80 ADDR=127.0.0.1 | ||
279 | 48 | .fi | ||
280 | 49 | .RE | ||
281 | 50 | .\" | ||
282 | 51 | .SS Local socket | ||
283 | 52 | .P | ||
284 | 53 | .RS | ||
285 | 54 | .nf | ||
286 | 55 | |||
287 | 56 | start on socket PROTO=unix PATH=/var/run/.s.pgsql.1234 | ||
288 | 57 | .fi | ||
289 | 58 | .FE | ||
290 | 59 | .\" | ||
291 | 60 | .SS Abstract socket | ||
292 | 61 | .P | ||
293 | 62 | |||
294 | 63 | .RS | ||
295 | 64 | .nf | ||
296 | 65 | |||
297 | 66 | start on socket PROTO=unix PATH=@/at/upstart/example | ||
298 | 67 | .fi | ||
299 | 68 | .FE | ||
300 | 69 | .\" | ||
301 | 70 | .SH AUTHOR | ||
302 | 71 | Written by Scott James Remnant | ||
303 | 72 | .RB < scott@netsplit.com > | ||
304 | 73 | |||
305 | 74 | Manual page written by James Hunt | ||
306 | 75 | .RB < james.hunt@ubuntu.com > | ||
307 | 76 | .\" | ||
308 | 77 | .SH BUGS | ||
309 | 78 | Report bugs at | ||
310 | 79 | .RB < https://launchpad.net/upstart/+bugs > | ||
311 | 80 | .\" | ||
312 | 81 | .SH COPYRIGHT | ||
313 | 82 | Copyright \(co 2011 Canonical Ltd. | ||
314 | 83 | .PP | ||
315 | 84 | This is free software; see the source for copying conditions. There is NO | ||
316 | 85 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
317 | 86 | .\" | ||
318 | 87 | .SH SEE ALSO | ||
319 | 88 | .BR init (5) | ||
320 | 89 | .BR init (8) | ||
321 | 90 | .BR socket (2) | ||
322 | 91 | .BR socket (7) | ||
323 | 92 | .BR upstart\-socket\-bridge (8) | ||
324 | 0 | 93 | ||
325 | === added file 'extra/man/upstart-socket-bridge.8' | |||
326 | --- extra/man/upstart-socket-bridge.8 1970-01-01 00:00:00 +0000 | |||
327 | +++ extra/man/upstart-socket-bridge.8 2011-05-15 18:31:10 +0000 | |||
328 | @@ -0,0 +1,47 @@ | |||
329 | 1 | .TH upstart-socket-bridge 8 2011-03-08 upstart | ||
330 | 2 | .\" | ||
331 | 3 | .SH NAME | ||
332 | 4 | upstart-socket-bridge \- Bridge between Upstart and sockets | ||
333 | 5 | .\" | ||
334 | 6 | .SH SYNOPSIS | ||
335 | 7 | .B upstart-socket-bridge | ||
336 | 8 | .RI [ OPTIONS ]... | ||
337 | 9 | .\" | ||
338 | 10 | .SH DESCRIPTION | ||
339 | 11 | The | ||
340 | 12 | .B upstart-socket-bridge | ||
341 | 13 | queries the Upstart | ||
342 | 14 | .BR init (8) | ||
343 | 15 | daemon for all job configurations which | ||
344 | 16 | .B start on | ||
345 | 17 | or | ||
346 | 18 | .B stop on | ||
347 | 19 | the socket event. It then waits for an incoming connection on each | ||
348 | 20 | specified | ||
349 | 21 | .BR socket (7) | ||
350 | 22 | and when detected emits the socket event (\fBsocket\-event\fP (7)), | ||
351 | 23 | setting a number of environment variables for the job to query. | ||
352 | 24 | .\" | ||
353 | 25 | .SH AUTHOR | ||
354 | 26 | Written by Scott James Remnant | ||
355 | 27 | .RB < scott@netsplit.com > | ||
356 | 28 | |||
357 | 29 | Manual page written by James Hunt | ||
358 | 30 | .RB < james.hunt@ubuntu.com > | ||
359 | 31 | .\" | ||
360 | 32 | .SH BUGS | ||
361 | 33 | Report bugs at | ||
362 | 34 | .RB < https://launchpad.net/upstart/+bugs > | ||
363 | 35 | .\" | ||
364 | 36 | .SH COPYRIGHT | ||
365 | 37 | Copyright \(co 2011 Canonical Ltd. | ||
366 | 38 | .PP | ||
367 | 39 | This is free software; see the source for copying conditions. There is NO | ||
368 | 40 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
369 | 41 | .\" | ||
370 | 42 | .SH SEE ALSO | ||
371 | 43 | .BR init (5) | ||
372 | 44 | .BR init (8) | ||
373 | 45 | .BR socket (2) | ||
374 | 46 | .BR socket (7) | ||
375 | 47 | .BR socket\-event (7) | ||
376 | 0 | 48 | ||
377 | === added file 'extra/man/upstart-udev-bridge.8' | |||
378 | --- extra/man/upstart-udev-bridge.8 1970-01-01 00:00:00 +0000 | |||
379 | +++ extra/man/upstart-udev-bridge.8 2011-05-15 18:31:10 +0000 | |||
380 | @@ -0,0 +1,35 @@ | |||
381 | 1 | .TH upstart-udev-bridge 8 2009-09-07 upstart | ||
382 | 2 | .\" | ||
383 | 3 | .SH NAME | ||
384 | 4 | upstart-udev-bridge \- Bridge between Upstart and udev | ||
385 | 5 | .\" | ||
386 | 6 | .SH SYNOPSIS | ||
387 | 7 | .B upstart-udev-bridge | ||
388 | 8 | .RI [ OPTIONS ]... | ||
389 | 9 | .\" | ||
390 | 10 | .SH DESCRIPTION | ||
391 | 11 | .B upstart-udev-bridge | ||
392 | 12 | receives information about kernel uevents that | ||
393 | 13 | .BR udev (8) | ||
394 | 14 | has completed and creates | ||
395 | 15 | .BR init (8) | ||
396 | 16 | events for them. | ||
397 | 17 | |||
398 | 18 | This is a temporary tool until | ||
399 | 19 | .BR init (8) | ||
400 | 20 | itself gains the functionality to read them directly; you should not | ||
401 | 21 | rely on its behaviour. | ||
402 | 22 | .\" | ||
403 | 23 | .SH AUTHOR | ||
404 | 24 | Written by Scott James Remnant | ||
405 | 25 | .RB < scott@netsplit.com > | ||
406 | 26 | .\" | ||
407 | 27 | .SH BUGS | ||
408 | 28 | Report bugs at | ||
409 | 29 | .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > | ||
410 | 30 | .\" | ||
411 | 31 | .SH COPYRIGHT | ||
412 | 32 | Copyright \(co 2009 Canonical Ltd. | ||
413 | 33 | .PP | ||
414 | 34 | This is free software; see the source for copying conditions. There is NO | ||
415 | 35 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
416 | 0 | 36 | ||
417 | === added file 'extra/upstart-socket-bridge.c' | |||
418 | --- extra/upstart-socket-bridge.c 1970-01-01 00:00:00 +0000 | |||
419 | +++ extra/upstart-socket-bridge.c 2011-05-15 18:31:10 +0000 | |||
420 | @@ -0,0 +1,644 @@ | |||
421 | 1 | /* upstart | ||
422 | 2 | * | ||
423 | 3 | * Copyright © 2010 Canonical Ltd. | ||
424 | 4 | * Author: Scott James Remnant <scott@netsplit.com>. | ||
425 | 5 | * | ||
426 | 6 | * This program is free software; you can redistribute it and/or modify | ||
427 | 7 | * it under the terms of the GNU General Public License version 2, as | ||
428 | 8 | * published by the Free Software Foundation. | ||
429 | 9 | * | ||
430 | 10 | * This program is distributed in the hope that it will be useful, | ||
431 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
432 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
433 | 13 | * GNU General Public License for more details. | ||
434 | 14 | * | ||
435 | 15 | * You should have received a copy of the GNU General Public License along | ||
436 | 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
437 | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
438 | 18 | */ | ||
439 | 19 | |||
440 | 20 | #ifdef HAVE_CONFIG_H | ||
441 | 21 | # include <config.h> | ||
442 | 22 | #endif /* HAVE_CONFIG_H */ | ||
443 | 23 | |||
444 | 24 | |||
445 | 25 | #include <sys/epoll.h> | ||
446 | 26 | #include <sys/types.h> | ||
447 | 27 | #include <sys/socket.h> | ||
448 | 28 | #include <sys/un.h> | ||
449 | 29 | |||
450 | 30 | #include <netinet/in.h> | ||
451 | 31 | #include <arpa/inet.h> | ||
452 | 32 | |||
453 | 33 | #include <errno.h> | ||
454 | 34 | #include <stdlib.h> | ||
455 | 35 | #include <string.h> | ||
456 | 36 | #include <syslog.h> | ||
457 | 37 | #include <unistd.h> | ||
458 | 38 | |||
459 | 39 | #include <nih/macros.h> | ||
460 | 40 | #include <nih/alloc.h> | ||
461 | 41 | #include <nih/list.h> | ||
462 | 42 | #include <nih/hash.h> | ||
463 | 43 | #include <nih/string.h> | ||
464 | 44 | #include <nih/io.h> | ||
465 | 45 | #include <nih/option.h> | ||
466 | 46 | #include <nih/main.h> | ||
467 | 47 | #include <nih/logging.h> | ||
468 | 48 | #include <nih/error.h> | ||
469 | 49 | |||
470 | 50 | #include <nih-dbus/dbus_connection.h> | ||
471 | 51 | #include <nih-dbus/dbus_proxy.h> | ||
472 | 52 | |||
473 | 53 | #include "dbus/upstart.h" | ||
474 | 54 | #include "com.ubuntu.Upstart.h" | ||
475 | 55 | #include "com.ubuntu.Upstart.Job.h" | ||
476 | 56 | |||
477 | 57 | |||
478 | 58 | /* Structure we use for tracking jobs */ | ||
479 | 59 | typedef struct job { | ||
480 | 60 | NihList entry; | ||
481 | 61 | char *path; | ||
482 | 62 | NihList sockets; | ||
483 | 63 | } Job; | ||
484 | 64 | |||
485 | 65 | /* Structure we use for tracking listening sockets */ | ||
486 | 66 | typedef struct socket { | ||
487 | 67 | NihList entry; | ||
488 | 68 | |||
489 | 69 | union { | ||
490 | 70 | struct sockaddr addr; | ||
491 | 71 | struct sockaddr_in sin_addr; | ||
492 | 72 | struct sockaddr_un sun_addr; | ||
493 | 73 | }; | ||
494 | 74 | socklen_t addrlen; | ||
495 | 75 | |||
496 | 76 | int sock; | ||
497 | 77 | } Socket; | ||
498 | 78 | |||
499 | 79 | |||
500 | 80 | /* Prototypes for static functions */ | ||
501 | 81 | static void epoll_watcher (void *data, NihIoWatch *watch, | ||
502 | 82 | NihIoEvents events); | ||
503 | 83 | static void upstart_job_added (void *data, NihDBusMessage *message, | ||
504 | 84 | const char *job); | ||
505 | 85 | static void upstart_job_removed (void *data, NihDBusMessage *message, | ||
506 | 86 | const char *job); | ||
507 | 87 | static void job_add_socket (Job *job, char **socket_info); | ||
508 | 88 | static void socket_destroy (Socket *socket); | ||
509 | 89 | static void upstart_disconnected (DBusConnection *connection); | ||
510 | 90 | static void emit_event_reply (Socket *sock, NihDBusMessage *message); | ||
511 | 91 | static void emit_event_error (Socket *sock, NihDBusMessage *message); | ||
512 | 92 | |||
513 | 93 | |||
514 | 94 | /** | ||
515 | 95 | * daemonise: | ||
516 | 96 | * | ||
517 | 97 | * Set to TRUE if we should become a daemon, rather than just running | ||
518 | 98 | * in the foreground. | ||
519 | 99 | **/ | ||
520 | 100 | static int daemonise = FALSE; | ||
521 | 101 | |||
522 | 102 | /** | ||
523 | 103 | * epoll_fd: | ||
524 | 104 | * | ||
525 | 105 | * Shared epoll file descriptor for listening on. | ||
526 | 106 | **/ | ||
527 | 107 | static int epoll_fd = -1; | ||
528 | 108 | |||
529 | 109 | /** | ||
530 | 110 | * jobs: | ||
531 | 111 | * | ||
532 | 112 | * Jobs that we're monitoring. | ||
533 | 113 | **/ | ||
534 | 114 | static NihHash *jobs = NULL; | ||
535 | 115 | |||
536 | 116 | /** | ||
537 | 117 | * upstart: | ||
538 | 118 | * | ||
539 | 119 | * Proxy to Upstart daemon. | ||
540 | 120 | **/ | ||
541 | 121 | static NihDBusProxy *upstart = NULL; | ||
542 | 122 | |||
543 | 123 | |||
544 | 124 | /** | ||
545 | 125 | * options: | ||
546 | 126 | * | ||
547 | 127 | * Command-line options accepted by this program. | ||
548 | 128 | **/ | ||
549 | 129 | static NihOption options[] = { | ||
550 | 130 | { 0, "daemon", N_("Detach and run in the background"), | ||
551 | 131 | NULL, NULL, &daemonise, NULL }, | ||
552 | 132 | |||
553 | 133 | NIH_OPTION_LAST | ||
554 | 134 | }; | ||
555 | 135 | |||
556 | 136 | |||
557 | 137 | int | ||
558 | 138 | main (int argc, | ||
559 | 139 | char *argv[]) | ||
560 | 140 | { | ||
561 | 141 | char ** args; | ||
562 | 142 | DBusConnection *connection; | ||
563 | 143 | char ** job_class_paths; | ||
564 | 144 | int ret; | ||
565 | 145 | |||
566 | 146 | nih_main_init (argv[0]); | ||
567 | 147 | |||
568 | 148 | nih_option_set_synopsis (_("Bridge socket events into upstart")); | ||
569 | 149 | nih_option_set_help ( | ||
570 | 150 | _("By default, upstart-socket-bridge does not detach from the " | ||
571 | 151 | "console and remains in the foreground. Use the --daemon " | ||
572 | 152 | "option to have it detach.")); | ||
573 | 153 | |||
574 | 154 | args = nih_option_parser (NULL, argc, argv, options, FALSE); | ||
575 | 155 | if (! args) | ||
576 | 156 | exit (1); | ||
577 | 157 | |||
578 | 158 | /* Create an epoll file descriptor for listening on; use this so | ||
579 | 159 | * we can do edge triggering rather than level. | ||
580 | 160 | */ | ||
581 | 161 | epoll_fd = epoll_create1 (0); | ||
582 | 162 | if (epoll_fd < 0) { | ||
583 | 163 | nih_fatal ("%s: %s", _("Could not create epoll descriptor"), | ||
584 | 164 | strerror (errno)); | ||
585 | 165 | exit (1); | ||
586 | 166 | } | ||
587 | 167 | |||
588 | 168 | NIH_MUST (nih_io_add_watch (NULL, epoll_fd, NIH_IO_READ, | ||
589 | 169 | epoll_watcher, NULL)); | ||
590 | 170 | |||
591 | 171 | /* Allocate jobs hash table */ | ||
592 | 172 | jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); | ||
593 | 173 | |||
594 | 174 | /* Initialise the connection to Upstart */ | ||
595 | 175 | connection = NIH_SHOULD (nih_dbus_connect (DBUS_ADDRESS_UPSTART, upstart_disconnected)); | ||
596 | 176 | if (! connection) { | ||
597 | 177 | NihError *err; | ||
598 | 178 | |||
599 | 179 | err = nih_error_get (); | ||
600 | 180 | nih_fatal ("%s: %s", _("Could not connect to Upstart"), | ||
601 | 181 | err->message); | ||
602 | 182 | nih_free (err); | ||
603 | 183 | |||
604 | 184 | exit (1); | ||
605 | 185 | } | ||
606 | 186 | |||
607 | 187 | upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, | ||
608 | 188 | NULL, DBUS_PATH_UPSTART, | ||
609 | 189 | NULL, NULL)); | ||
610 | 190 | if (! upstart) { | ||
611 | 191 | NihError *err; | ||
612 | 192 | |||
613 | 193 | err = nih_error_get (); | ||
614 | 194 | nih_fatal ("%s: %s", _("Could not create Upstart proxy"), | ||
615 | 195 | err->message); | ||
616 | 196 | nih_free (err); | ||
617 | 197 | |||
618 | 198 | exit (1); | ||
619 | 199 | } | ||
620 | 200 | |||
621 | 201 | /* Connect signals to be notified when jobs come and go */ | ||
622 | 202 | if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobAdded", | ||
623 | 203 | (NihDBusSignalHandler)upstart_job_added, NULL)) { | ||
624 | 204 | NihError *err; | ||
625 | 205 | |||
626 | 206 | err = nih_error_get (); | ||
627 | 207 | nih_fatal ("%s: %s", _("Could not create JobAdded signal connection"), | ||
628 | 208 | err->message); | ||
629 | 209 | nih_free (err); | ||
630 | 210 | |||
631 | 211 | exit (1); | ||
632 | 212 | } | ||
633 | 213 | |||
634 | 214 | if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobRemoved", | ||
635 | 215 | (NihDBusSignalHandler)upstart_job_removed, NULL)) { | ||
636 | 216 | NihError *err; | ||
637 | 217 | |||
638 | 218 | err = nih_error_get (); | ||
639 | 219 | nih_fatal ("%s: %s", _("Could not create JobRemoved signal connection"), | ||
640 | 220 | err->message); | ||
641 | 221 | nih_free (err); | ||
642 | 222 | |||
643 | 223 | exit (1); | ||
644 | 224 | } | ||
645 | 225 | |||
646 | 226 | /* Request a list of all current jobs */ | ||
647 | 227 | if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) { | ||
648 | 228 | NihError *err; | ||
649 | 229 | |||
650 | 230 | err = nih_error_get (); | ||
651 | 231 | nih_fatal ("%s: %s", _("Could not obtain job list"), | ||
652 | 232 | err->message); | ||
653 | 233 | nih_free (err); | ||
654 | 234 | |||
655 | 235 | exit (1); | ||
656 | 236 | } | ||
657 | 237 | |||
658 | 238 | for (char **job_class_path = job_class_paths; | ||
659 | 239 | job_class_path && *job_class_path; job_class_path++) | ||
660 | 240 | upstart_job_added (NULL, NULL, *job_class_path); | ||
661 | 241 | |||
662 | 242 | nih_free (job_class_paths); | ||
663 | 243 | |||
664 | 244 | /* Become daemon */ | ||
665 | 245 | if (daemonise) { | ||
666 | 246 | if (nih_main_daemonise () < 0) { | ||
667 | 247 | NihError *err; | ||
668 | 248 | |||
669 | 249 | err = nih_error_get (); | ||
670 | 250 | nih_fatal ("%s: %s", _("Unable to become daemon"), | ||
671 | 251 | err->message); | ||
672 | 252 | nih_free (err); | ||
673 | 253 | |||
674 | 254 | exit (1); | ||
675 | 255 | } | ||
676 | 256 | |||
677 | 257 | /* Send all logging output to syslog */ | ||
678 | 258 | openlog (program_name, LOG_PID, LOG_DAEMON); | ||
679 | 259 | nih_log_set_logger (nih_logger_syslog); | ||
680 | 260 | } | ||
681 | 261 | |||
682 | 262 | /* Handle TERM and INT signals gracefully */ | ||
683 | 263 | nih_signal_set_handler (SIGTERM, nih_signal_handler); | ||
684 | 264 | NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); | ||
685 | 265 | |||
686 | 266 | if (! daemonise) { | ||
687 | 267 | nih_signal_set_handler (SIGINT, nih_signal_handler); | ||
688 | 268 | NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); | ||
689 | 269 | } | ||
690 | 270 | |||
691 | 271 | ret = nih_main_loop (); | ||
692 | 272 | |||
693 | 273 | return ret; | ||
694 | 274 | } | ||
695 | 275 | |||
696 | 276 | |||
697 | 277 | static void | ||
698 | 278 | epoll_watcher (void * data, | ||
699 | 279 | NihIoWatch *watch, | ||
700 | 280 | NihIoEvents events) | ||
701 | 281 | { | ||
702 | 282 | struct epoll_event event[1024]; | ||
703 | 283 | int num_events; | ||
704 | 284 | |||
705 | 285 | num_events = epoll_wait (epoll_fd, event, 1024, 0); | ||
706 | 286 | if (num_events < 0) { | ||
707 | 287 | nih_error ("%s: %s", _("Error from epoll"), strerror (errno)); | ||
708 | 288 | return; | ||
709 | 289 | } else if (num_events == 0) | ||
710 | 290 | return; | ||
711 | 291 | |||
712 | 292 | for (int i = 0; i < num_events; i++) { | ||
713 | 293 | Socket *sock = (Socket *)event[i].data.ptr; | ||
714 | 294 | nih_local char **env = NULL; | ||
715 | 295 | size_t env_len = 0; | ||
716 | 296 | char *var; | ||
717 | 297 | DBusPendingCall *pending_call; | ||
718 | 298 | |||
719 | 299 | if (event[i].events & EPOLLIN) | ||
720 | 300 | nih_debug ("%p EPOLLIN", sock); | ||
721 | 301 | if (event[i].events & EPOLLERR) | ||
722 | 302 | nih_debug ("%p EPOLLERR", sock); | ||
723 | 303 | if (event[i].events & EPOLLHUP) | ||
724 | 304 | nih_debug ("%p EPOLLHUP", sock); | ||
725 | 305 | |||
726 | 306 | env = NIH_MUST (nih_str_array_new (NULL)); | ||
727 | 307 | |||
728 | 308 | switch (sock->addr.sa_family) { | ||
729 | 309 | case AF_INET: | ||
730 | 310 | NIH_MUST (nih_str_array_add (&env, NULL, &env_len, | ||
731 | 311 | "PROTO=inet")); | ||
732 | 312 | |||
733 | 313 | var = NIH_MUST (nih_sprintf (NULL, "PORT=%d", | ||
734 | 314 | ntohs (sock->sin_addr.sin_port))); | ||
735 | 315 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, | ||
736 | 316 | var)); | ||
737 | 317 | nih_discard (var); | ||
738 | 318 | |||
739 | 319 | var = NIH_MUST (nih_sprintf (NULL, "ADDR=%s", | ||
740 | 320 | inet_ntoa (sock->sin_addr.sin_addr))); | ||
741 | 321 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, | ||
742 | 322 | var)); | ||
743 | 323 | nih_discard (var); | ||
744 | 324 | break; | ||
745 | 325 | case AF_UNIX: | ||
746 | 326 | NIH_MUST (nih_str_array_add (&env, NULL, &env_len, | ||
747 | 327 | "PROTO=unix")); | ||
748 | 328 | |||
749 | 329 | var = NIH_MUST (nih_sprintf (NULL, "PATH=%s", | ||
750 | 330 | sock->sun_addr.sun_path)); | ||
751 | 331 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, | ||
752 | 332 | var)); | ||
753 | 333 | nih_discard (var); | ||
754 | 334 | break; | ||
755 | 335 | default: | ||
756 | 336 | nih_assert_not_reached (); | ||
757 | 337 | } | ||
758 | 338 | |||
759 | 339 | pending_call = NIH_SHOULD (upstart_emit_event_with_file ( | ||
760 | 340 | upstart, "socket", env, TRUE, | ||
761 | 341 | sock->sock, | ||
762 | 342 | (UpstartEmitEventWithFileReply)emit_event_reply, | ||
763 | 343 | (NihDBusErrorHandler)emit_event_error, | ||
764 | 344 | sock, | ||
765 | 345 | NIH_DBUS_TIMEOUT_NEVER)); | ||
766 | 346 | if (! pending_call) { | ||
767 | 347 | NihError *err; | ||
768 | 348 | |||
769 | 349 | err = nih_error_get (); | ||
770 | 350 | nih_warn ("%s: %s", _("Could not send socket event"), | ||
771 | 351 | err->message); | ||
772 | 352 | nih_free (err); | ||
773 | 353 | } | ||
774 | 354 | |||
775 | 355 | dbus_pending_call_unref (pending_call); | ||
776 | 356 | |||
777 | 357 | // might be EPOLLIN | ||
778 | 358 | // might be EPOLLERR | ||
779 | 359 | // might be EPOLLHUP | ||
780 | 360 | } | ||
781 | 361 | } | ||
782 | 362 | |||
783 | 363 | |||
784 | 364 | static void | ||
785 | 365 | upstart_job_added (void * data, | ||
786 | 366 | NihDBusMessage *message, | ||
787 | 367 | const char * job_class_path) | ||
788 | 368 | { | ||
789 | 369 | nih_local NihDBusProxy *job_class = NULL; | ||
790 | 370 | nih_local char ***start_on = NULL; | ||
791 | 371 | nih_local char ***stop_on = NULL; | ||
792 | 372 | Job *job; | ||
793 | 373 | |||
794 | 374 | nih_assert (job_class_path != NULL); | ||
795 | 375 | |||
796 | 376 | /* Obtain a proxy to the job */ | ||
797 | 377 | job_class = nih_dbus_proxy_new (NULL, upstart->connection, | ||
798 | 378 | upstart->name, job_class_path, | ||
799 | 379 | NULL, NULL); | ||
800 | 380 | if (! job_class) { | ||
801 | 381 | NihError *err; | ||
802 | 382 | |||
803 | 383 | err = nih_error_get (); | ||
804 | 384 | nih_error ("Could not create proxy for job %s: %s", | ||
805 | 385 | job_class_path, err->message); | ||
806 | 386 | nih_free (err); | ||
807 | 387 | |||
808 | 388 | return; | ||
809 | 389 | } | ||
810 | 390 | |||
811 | 391 | job_class->auto_start = FALSE; | ||
812 | 392 | |||
813 | 393 | /* Obtain the start_on and stop_on properties of the job */ | ||
814 | 394 | if (job_class_get_start_on_sync (NULL, job_class, &start_on) < 0) { | ||
815 | 395 | NihError *err; | ||
816 | 396 | |||
817 | 397 | err = nih_error_get (); | ||
818 | 398 | nih_error ("Could not obtain job start condition %s: %s", | ||
819 | 399 | job_class_path, err->message); | ||
820 | 400 | nih_free (err); | ||
821 | 401 | |||
822 | 402 | return; | ||
823 | 403 | } | ||
824 | 404 | |||
825 | 405 | if (job_class_get_stop_on_sync (NULL, job_class, &stop_on) < 0) { | ||
826 | 406 | NihError *err; | ||
827 | 407 | |||
828 | 408 | err = nih_error_get (); | ||
829 | 409 | nih_error ("Could not obtain job stop condition %s: %s", | ||
830 | 410 | job_class_path, err->message); | ||
831 | 411 | nih_free (err); | ||
832 | 412 | |||
833 | 413 | return; | ||
834 | 414 | } | ||
835 | 415 | |||
836 | 416 | /* Free any existing record for the job (should never happen, | ||
837 | 417 | * but worth being safe). | ||
838 | 418 | */ | ||
839 | 419 | job = (Job *)nih_hash_lookup (jobs, job_class_path); | ||
840 | 420 | if (job) | ||
841 | 421 | nih_free (job); | ||
842 | 422 | |||
843 | 423 | /* Create new record for the job */ | ||
844 | 424 | job = NIH_MUST (nih_new (NULL, Job)); | ||
845 | 425 | job->path = NIH_MUST (nih_strdup (job, job_class_path)); | ||
846 | 426 | |||
847 | 427 | nih_list_init (&job->entry); | ||
848 | 428 | nih_list_init (&job->sockets); | ||
849 | 429 | |||
850 | 430 | /* Find out whether this job listens for any socket events */ | ||
851 | 431 | for (char ***event = start_on; event && *event && **event; event++) | ||
852 | 432 | if (! strcmp (**event, "socket")) | ||
853 | 433 | job_add_socket (job, *event); | ||
854 | 434 | for (char ***event = stop_on; event && *event && **event; event++) | ||
855 | 435 | if (! strcmp (**event, "socket")) | ||
856 | 436 | job_add_socket (job, *event); | ||
857 | 437 | |||
858 | 438 | /* If we didn't end up with any sockets, free the job and move on */ | ||
859 | 439 | if (NIH_LIST_EMPTY (&job->sockets)) { | ||
860 | 440 | nih_free (job); | ||
861 | 441 | return; | ||
862 | 442 | } | ||
863 | 443 | |||
864 | 444 | nih_debug ("Job got added %s", job_class_path); | ||
865 | 445 | |||
866 | 446 | nih_alloc_set_destructor (job, nih_list_destroy); | ||
867 | 447 | nih_hash_add (jobs, &job->entry); | ||
868 | 448 | } | ||
869 | 449 | |||
870 | 450 | static void | ||
871 | 451 | upstart_job_removed (void * data, | ||
872 | 452 | NihDBusMessage *message, | ||
873 | 453 | const char * job_path) | ||
874 | 454 | { | ||
875 | 455 | Job *job; | ||
876 | 456 | |||
877 | 457 | nih_assert (job_path != NULL); | ||
878 | 458 | |||
879 | 459 | job = (Job *)nih_hash_lookup (jobs, job_path); | ||
880 | 460 | if (job) { | ||
881 | 461 | nih_debug ("Job went away %s", job_path); | ||
882 | 462 | nih_free (job); | ||
883 | 463 | } | ||
884 | 464 | } | ||
885 | 465 | |||
886 | 466 | |||
887 | 467 | static void | ||
888 | 468 | job_add_socket (Job * job, | ||
889 | 469 | char **socket_info) | ||
890 | 470 | { | ||
891 | 471 | Socket *sock; | ||
892 | 472 | nih_local char *error = NULL; | ||
893 | 473 | int components = 0; | ||
894 | 474 | struct epoll_event event; | ||
895 | 475 | |||
896 | 476 | nih_assert (job != NULL); | ||
897 | 477 | nih_assert (socket_info != NULL); | ||
898 | 478 | nih_assert (! strcmp(socket_info[0], "socket")); | ||
899 | 479 | |||
900 | 480 | sock = NIH_MUST (nih_new (job, Socket)); | ||
901 | 481 | memset (sock, 0, sizeof (Socket)); | ||
902 | 482 | sock->sock = -1; | ||
903 | 483 | |||
904 | 484 | nih_list_init (&sock->entry); | ||
905 | 485 | |||
906 | 486 | nih_debug ("Found socket"); | ||
907 | 487 | for (char **env = socket_info + 1; env && *env; env++) { | ||
908 | 488 | char *val; | ||
909 | 489 | size_t name_len; | ||
910 | 490 | |||
911 | 491 | val = strchr (*env, '='); | ||
912 | 492 | if (! val) { | ||
913 | 493 | nih_warn ("Ignored socket event without variable name in %s", | ||
914 | 494 | job->path); | ||
915 | 495 | goto error; | ||
916 | 496 | } | ||
917 | 497 | |||
918 | 498 | name_len = val - *env; | ||
919 | 499 | val++; | ||
920 | 500 | |||
921 | 501 | if (! strncmp (*env, "PROTO", name_len)) { | ||
922 | 502 | if (! strcmp (val, "inet")) { | ||
923 | 503 | sock->addrlen = sizeof sock->sin_addr; | ||
924 | 504 | sock->sin_addr.sin_family = AF_INET; | ||
925 | 505 | sock->sin_addr.sin_addr.s_addr = INADDR_ANY; | ||
926 | 506 | components = 1; | ||
927 | 507 | } else if (! strcmp (val, "unix")) { | ||
928 | 508 | sock->addrlen = sizeof sock->sun_addr; | ||
929 | 509 | sock->sun_addr.sun_family = AF_UNIX; | ||
930 | 510 | components = 1; | ||
931 | 511 | } else { | ||
932 | 512 | nih_warn ("Ignored socket event with unknown PROTO=%s in %s", | ||
933 | 513 | val, job->path); | ||
934 | 514 | goto error; | ||
935 | 515 | } | ||
936 | 516 | |||
937 | 517 | } else if (! strncmp (*env, "PORT", name_len) | ||
938 | 518 | && (sock->sin_addr.sin_family == AF_INET)) { | ||
939 | 519 | sock->sin_addr.sin_port = htons (atoi (val)); | ||
940 | 520 | components--; | ||
941 | 521 | |||
942 | 522 | } else if (! strncmp (*env, "ADDR", name_len) | ||
943 | 523 | && (sock->sin_addr.sin_family == AF_INET)) { | ||
944 | 524 | if (inet_aton (val, &(sock->sin_addr.sin_addr)) == 0) { | ||
945 | 525 | nih_warn ("Ignored socket event with invalid ADDR=%s in %s", | ||
946 | 526 | val, job->path); | ||
947 | 527 | goto error; | ||
948 | 528 | } | ||
949 | 529 | |||
950 | 530 | } else if (! strncmp (*env, "PATH", name_len) | ||
951 | 531 | && (sock->sun_addr.sun_family == AF_UNIX)) { | ||
952 | 532 | strncpy (sock->sun_addr.sun_path, val, | ||
953 | 533 | sizeof sock->sun_addr.sun_path); | ||
954 | 534 | |||
955 | 535 | if (sock->sun_addr.sun_path[0] == '@') | ||
956 | 536 | sock->sun_addr.sun_path[0] = '\0'; | ||
957 | 537 | |||
958 | 538 | components--; | ||
959 | 539 | |||
960 | 540 | } else { | ||
961 | 541 | nih_warn ("Ignored socket event with unknown variable %.*s in %s", | ||
962 | 542 | (int)name_len, *env, job->path); | ||
963 | 543 | goto error; | ||
964 | 544 | } | ||
965 | 545 | } | ||
966 | 546 | |||
967 | 547 | /* Missing any required components? */ | ||
968 | 548 | if (components) { | ||
969 | 549 | nih_warn ("Ignored incomplete socket event in %s", | ||
970 | 550 | job->path); | ||
971 | 551 | goto error; | ||
972 | 552 | } | ||
973 | 553 | |||
974 | 554 | /* Let's try and set this baby up */ | ||
975 | 555 | sock->sock = socket (sock->addr.sa_family, SOCK_STREAM, 0); | ||
976 | 556 | if (sock->sock < 0) { | ||
977 | 557 | nih_warn ("Failed to create socket in %s: %s", | ||
978 | 558 | job->path, strerror (errno)); | ||
979 | 559 | goto error; | ||
980 | 560 | } | ||
981 | 561 | |||
982 | 562 | int opt = 1; | ||
983 | 563 | if (setsockopt (sock->sock, SOL_SOCKET, SO_REUSEADDR, | ||
984 | 564 | &opt, sizeof opt) < 0) { | ||
985 | 565 | nih_warn ("Failed to set socket reuse in %s: %s", | ||
986 | 566 | job->path, strerror (errno)); | ||
987 | 567 | goto error; | ||
988 | 568 | } | ||
989 | 569 | |||
990 | 570 | if (bind (sock->sock, &sock->addr, sock->addrlen) < 0) { | ||
991 | 571 | nih_warn ("Failed to bind socket in %s: %s", | ||
992 | 572 | job->path, strerror (errno)); | ||
993 | 573 | goto error; | ||
994 | 574 | } | ||
995 | 575 | |||
996 | 576 | if (listen (sock->sock, SOMAXCONN) < 0) { | ||
997 | 577 | nih_warn ("Failed to listen on socket in %s: %s", | ||
998 | 578 | job->path, strerror (errno)); | ||
999 | 579 | goto error; | ||
1000 | 580 | } | ||
1001 | 581 | |||
1002 | 582 | /* We have a listening socket, now we want to be notified when someone | ||
1003 | 583 | * connects; but we just want one notification, we don't want to get | ||
1004 | 584 | * a DDoS of wake-ups while waiting for the service to start. | ||
1005 | 585 | * | ||
1006 | 586 | * The solution is to use epoll in edge-triggered mode, this will | ||
1007 | 587 | * fire only on initial connection until a new one comes in. | ||
1008 | 588 | */ | ||
1009 | 589 | event.events = EPOLLIN | EPOLLET; | ||
1010 | 590 | event.data.ptr = sock; | ||
1011 | 591 | |||
1012 | 592 | if (epoll_ctl (epoll_fd, EPOLL_CTL_ADD, sock->sock, &event) < 0) { | ||
1013 | 593 | nih_warn ("Failed to watch socket in %s: %s", | ||
1014 | 594 | job->path, strerror (errno)); | ||
1015 | 595 | goto error; | ||
1016 | 596 | } | ||
1017 | 597 | |||
1018 | 598 | /* Okay then, add to the job */ | ||
1019 | 599 | nih_alloc_set_destructor (sock, socket_destroy); | ||
1020 | 600 | nih_list_add (&job->sockets, &sock->entry); | ||
1021 | 601 | |||
1022 | 602 | return; | ||
1023 | 603 | |||
1024 | 604 | error: | ||
1025 | 605 | if (sock->sock != -1) | ||
1026 | 606 | close (sock->sock); | ||
1027 | 607 | nih_free (sock); | ||
1028 | 608 | } | ||
1029 | 609 | |||
1030 | 610 | static void | ||
1031 | 611 | socket_destroy (Socket *sock) | ||
1032 | 612 | { | ||
1033 | 613 | epoll_ctl (epoll_fd, EPOLL_CTL_DEL, sock->sock, NULL); | ||
1034 | 614 | close (sock->sock); | ||
1035 | 615 | |||
1036 | 616 | nih_list_destroy (&sock->entry); | ||
1037 | 617 | } | ||
1038 | 618 | |||
1039 | 619 | |||
1040 | 620 | static void | ||
1041 | 621 | upstart_disconnected (DBusConnection *connection) | ||
1042 | 622 | { | ||
1043 | 623 | nih_fatal (_("Disconnected from Upstart")); | ||
1044 | 624 | nih_main_loop_exit (1); | ||
1045 | 625 | } | ||
1046 | 626 | |||
1047 | 627 | |||
1048 | 628 | static void | ||
1049 | 629 | emit_event_reply (Socket * sock, | ||
1050 | 630 | NihDBusMessage *message) | ||
1051 | 631 | { | ||
1052 | 632 | nih_debug ("Event completed"); | ||
1053 | 633 | } | ||
1054 | 634 | |||
1055 | 635 | static void | ||
1056 | 636 | emit_event_error (Socket * sock, | ||
1057 | 637 | NihDBusMessage *message) | ||
1058 | 638 | { | ||
1059 | 639 | NihError *err; | ||
1060 | 640 | |||
1061 | 641 | err = nih_error_get (); | ||
1062 | 642 | nih_warn ("%s: %s", _("Error emitting socket event"), err->message); | ||
1063 | 643 | nih_free (err); | ||
1064 | 644 | } | ||
1065 | 0 | 645 | ||
1066 | === added file 'extra/upstart-udev-bridge.c' | |||
1067 | --- extra/upstart-udev-bridge.c 1970-01-01 00:00:00 +0000 | |||
1068 | +++ extra/upstart-udev-bridge.c 2011-05-15 18:31:10 +0000 | |||
1069 | @@ -0,0 +1,310 @@ | |||
1070 | 1 | /* upstart | ||
1071 | 2 | * | ||
1072 | 3 | * Copyright © 2009 Canonical Ltd. | ||
1073 | 4 | * Author: Scott James Remnant <scott@netsplit.com>. | ||
1074 | 5 | * | ||
1075 | 6 | * This program is free software; you can redistribute it and/or modify | ||
1076 | 7 | * it under the terms of the GNU General Public License version 2, as | ||
1077 | 8 | * published by the Free Software Foundation. | ||
1078 | 9 | * | ||
1079 | 10 | * This program is distributed in the hope that it will be useful, | ||
1080 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1081 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1082 | 13 | * GNU General Public License for more details. | ||
1083 | 14 | * | ||
1084 | 15 | * You should have received a copy of the GNU General Public License along | ||
1085 | 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
1086 | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
1087 | 18 | */ | ||
1088 | 19 | |||
1089 | 20 | #ifdef HAVE_CONFIG_H | ||
1090 | 21 | # include <config.h> | ||
1091 | 22 | #endif /* HAVE_CONFIG_H */ | ||
1092 | 23 | |||
1093 | 24 | |||
1094 | 25 | #include <libudev.h> | ||
1095 | 26 | |||
1096 | 27 | #include <stdlib.h> | ||
1097 | 28 | #include <string.h> | ||
1098 | 29 | #include <syslog.h> | ||
1099 | 30 | |||
1100 | 31 | #include <nih/macros.h> | ||
1101 | 32 | #include <nih/alloc.h> | ||
1102 | 33 | #include <nih/string.h> | ||
1103 | 34 | #include <nih/io.h> | ||
1104 | 35 | #include <nih/option.h> | ||
1105 | 36 | #include <nih/main.h> | ||
1106 | 37 | #include <nih/logging.h> | ||
1107 | 38 | #include <nih/error.h> | ||
1108 | 39 | |||
1109 | 40 | #include <nih-dbus/dbus_connection.h> | ||
1110 | 41 | #include <nih-dbus/dbus_proxy.h> | ||
1111 | 42 | |||
1112 | 43 | #include "dbus/upstart.h" | ||
1113 | 44 | #include "com.ubuntu.Upstart.h" | ||
1114 | 45 | |||
1115 | 46 | |||
1116 | 47 | /* Prototypes for static functions */ | ||
1117 | 48 | static void udev_monitor_watcher (struct udev_monitor *udev_monitor, | ||
1118 | 49 | NihIoWatch *watch, NihIoEvents events); | ||
1119 | 50 | static void upstart_disconnected (DBusConnection *connection); | ||
1120 | 51 | static void emit_event_error (void *data, NihDBusMessage *message); | ||
1121 | 52 | |||
1122 | 53 | |||
1123 | 54 | /** | ||
1124 | 55 | * daemonise: | ||
1125 | 56 | * | ||
1126 | 57 | * Set to TRUE if we should become a daemon, rather than just running | ||
1127 | 58 | * in the foreground. | ||
1128 | 59 | **/ | ||
1129 | 60 | static int daemonise = FALSE; | ||
1130 | 61 | |||
1131 | 62 | /** | ||
1132 | 63 | * upstart: | ||
1133 | 64 | * | ||
1134 | 65 | * Proxy to Upstart daemon. | ||
1135 | 66 | **/ | ||
1136 | 67 | static NihDBusProxy *upstart = NULL; | ||
1137 | 68 | |||
1138 | 69 | |||
1139 | 70 | /** | ||
1140 | 71 | * options: | ||
1141 | 72 | * | ||
1142 | 73 | * Command-line options accepted by this program. | ||
1143 | 74 | **/ | ||
1144 | 75 | static NihOption options[] = { | ||
1145 | 76 | { 0, "daemon", N_("Detach and run in the background"), | ||
1146 | 77 | NULL, NULL, &daemonise, NULL }, | ||
1147 | 78 | |||
1148 | 79 | NIH_OPTION_LAST | ||
1149 | 80 | }; | ||
1150 | 81 | |||
1151 | 82 | |||
1152 | 83 | int | ||
1153 | 84 | main (int argc, | ||
1154 | 85 | char *argv[]) | ||
1155 | 86 | { | ||
1156 | 87 | char ** args; | ||
1157 | 88 | DBusConnection * connection; | ||
1158 | 89 | struct udev * udev; | ||
1159 | 90 | struct udev_monitor *udev_monitor; | ||
1160 | 91 | int ret; | ||
1161 | 92 | |||
1162 | 93 | nih_main_init (argv[0]); | ||
1163 | 94 | |||
1164 | 95 | nih_option_set_synopsis (_("Bridge udev events into upstart")); | ||
1165 | 96 | nih_option_set_help ( | ||
1166 | 97 | _("By default, upstart-udev-bridge does not detach from the " | ||
1167 | 98 | "console and remains in the foreground. Use the --daemon " | ||
1168 | 99 | "option to have it detach.")); | ||
1169 | 100 | |||
1170 | 101 | args = nih_option_parser (NULL, argc, argv, options, FALSE); | ||
1171 | 102 | if (! args) | ||
1172 | 103 | exit (1); | ||
1173 | 104 | |||
1174 | 105 | /* Initialise the connection to Upstart */ | ||
1175 | 106 | connection = NIH_SHOULD (nih_dbus_connect (DBUS_ADDRESS_UPSTART, upstart_disconnected)); | ||
1176 | 107 | if (! connection) { | ||
1177 | 108 | NihError *err; | ||
1178 | 109 | |||
1179 | 110 | err = nih_error_get (); | ||
1180 | 111 | nih_fatal ("%s: %s", _("Could not connect to Upstart"), | ||
1181 | 112 | err->message); | ||
1182 | 113 | nih_free (err); | ||
1183 | 114 | |||
1184 | 115 | exit (1); | ||
1185 | 116 | } | ||
1186 | 117 | |||
1187 | 118 | upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, | ||
1188 | 119 | NULL, DBUS_PATH_UPSTART, | ||
1189 | 120 | NULL, NULL)); | ||
1190 | 121 | if (! upstart) { | ||
1191 | 122 | NihError *err; | ||
1192 | 123 | |||
1193 | 124 | err = nih_error_get (); | ||
1194 | 125 | nih_fatal ("%s: %s", _("Could not create Upstart proxy"), | ||
1195 | 126 | err->message); | ||
1196 | 127 | nih_free (err); | ||
1197 | 128 | |||
1198 | 129 | exit (1); | ||
1199 | 130 | } | ||
1200 | 131 | |||
1201 | 132 | /* Initialise the connection to udev */ | ||
1202 | 133 | nih_assert (udev = udev_new ()); | ||
1203 | 134 | nih_assert (udev_monitor = udev_monitor_new_from_netlink (udev, "udev")); | ||
1204 | 135 | nih_assert (udev_monitor_enable_receiving (udev_monitor) == 0); | ||
1205 | 136 | udev_monitor_set_receive_buffer_size(udev_monitor, 128*1024*1024); | ||
1206 | 137 | |||
1207 | 138 | NIH_MUST (nih_io_add_watch (NULL, udev_monitor_get_fd (udev_monitor), | ||
1208 | 139 | NIH_IO_READ, | ||
1209 | 140 | (NihIoWatcher)udev_monitor_watcher, | ||
1210 | 141 | udev_monitor)); | ||
1211 | 142 | |||
1212 | 143 | /* Become daemon */ | ||
1213 | 144 | if (daemonise) { | ||
1214 | 145 | if (nih_main_daemonise () < 0) { | ||
1215 | 146 | NihError *err; | ||
1216 | 147 | |||
1217 | 148 | err = nih_error_get (); | ||
1218 | 149 | nih_fatal ("%s: %s", _("Unable to become daemon"), | ||
1219 | 150 | err->message); | ||
1220 | 151 | nih_free (err); | ||
1221 | 152 | |||
1222 | 153 | exit (1); | ||
1223 | 154 | } | ||
1224 | 155 | |||
1225 | 156 | /* Send all logging output to syslog */ | ||
1226 | 157 | openlog (program_name, LOG_PID, LOG_DAEMON); | ||
1227 | 158 | nih_log_set_logger (nih_logger_syslog); | ||
1228 | 159 | } | ||
1229 | 160 | |||
1230 | 161 | /* Handle TERM and INT signals gracefully */ | ||
1231 | 162 | nih_signal_set_handler (SIGTERM, nih_signal_handler); | ||
1232 | 163 | NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); | ||
1233 | 164 | |||
1234 | 165 | if (! daemonise) { | ||
1235 | 166 | nih_signal_set_handler (SIGINT, nih_signal_handler); | ||
1236 | 167 | NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); | ||
1237 | 168 | } | ||
1238 | 169 | |||
1239 | 170 | ret = nih_main_loop (); | ||
1240 | 171 | |||
1241 | 172 | return ret; | ||
1242 | 173 | } | ||
1243 | 174 | |||
1244 | 175 | |||
1245 | 176 | static void | ||
1246 | 177 | udev_monitor_watcher (struct udev_monitor *udev_monitor, | ||
1247 | 178 | NihIoWatch * watch, | ||
1248 | 179 | NihIoEvents events) | ||
1249 | 180 | { | ||
1250 | 181 | struct udev_device * udev_device; | ||
1251 | 182 | const char * subsystem; | ||
1252 | 183 | const char * action; | ||
1253 | 184 | const char * kernel; | ||
1254 | 185 | const char * devpath; | ||
1255 | 186 | const char * devname; | ||
1256 | 187 | nih_local char * name = NULL; | ||
1257 | 188 | nih_local char ** env = NULL; | ||
1258 | 189 | size_t env_len = 0; | ||
1259 | 190 | DBusPendingCall * pending_call; | ||
1260 | 191 | |||
1261 | 192 | udev_device = udev_monitor_receive_device (udev_monitor); | ||
1262 | 193 | if (! udev_device) | ||
1263 | 194 | return; | ||
1264 | 195 | |||
1265 | 196 | subsystem = udev_device_get_subsystem (udev_device); | ||
1266 | 197 | action = udev_device_get_action (udev_device); | ||
1267 | 198 | kernel = udev_device_get_sysname (udev_device); | ||
1268 | 199 | devpath = udev_device_get_devpath (udev_device); | ||
1269 | 200 | devname = udev_device_get_devnode (udev_device); | ||
1270 | 201 | |||
1271 | 202 | if (! strcmp (action, "add")) { | ||
1272 | 203 | name = NIH_MUST (nih_sprintf (NULL, "%s-device-added", | ||
1273 | 204 | subsystem)); | ||
1274 | 205 | } else if (! strcmp (action, "change")) { | ||
1275 | 206 | name = NIH_MUST (nih_sprintf (NULL, "%s-device-changed", | ||
1276 | 207 | subsystem)); | ||
1277 | 208 | } else if (! strcmp (action, "remove")) { | ||
1278 | 209 | name = NIH_MUST (nih_sprintf (NULL, "%s-device-removed", | ||
1279 | 210 | subsystem)); | ||
1280 | 211 | } else { | ||
1281 | 212 | name = NIH_MUST (nih_sprintf (NULL, "%s-device-%s", | ||
1282 | 213 | subsystem, action)); | ||
1283 | 214 | } | ||
1284 | 215 | |||
1285 | 216 | env = NIH_MUST (nih_str_array_new (NULL)); | ||
1286 | 217 | |||
1287 | 218 | if (kernel) { | ||
1288 | 219 | nih_local char *var = NULL; | ||
1289 | 220 | |||
1290 | 221 | var = NIH_MUST (nih_sprintf (NULL, "KERNEL=%s", kernel)); | ||
1291 | 222 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1292 | 223 | } | ||
1293 | 224 | |||
1294 | 225 | if (devpath) { | ||
1295 | 226 | nih_local char *var = NULL; | ||
1296 | 227 | |||
1297 | 228 | var = NIH_MUST (nih_sprintf (NULL, "DEVPATH=%s", devpath)); | ||
1298 | 229 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1299 | 230 | } | ||
1300 | 231 | |||
1301 | 232 | if (devname) { | ||
1302 | 233 | nih_local char *var = NULL; | ||
1303 | 234 | |||
1304 | 235 | var = NIH_MUST (nih_sprintf (NULL, "DEVNAME=%s", devname)); | ||
1305 | 236 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1306 | 237 | } | ||
1307 | 238 | |||
1308 | 239 | if (subsystem) { | ||
1309 | 240 | nih_local char *var = NULL; | ||
1310 | 241 | |||
1311 | 242 | var = NIH_MUST (nih_sprintf (NULL, "SUBSYSTEM=%s", subsystem)); | ||
1312 | 243 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1313 | 244 | } | ||
1314 | 245 | |||
1315 | 246 | if (action) { | ||
1316 | 247 | nih_local char *var = NULL; | ||
1317 | 248 | |||
1318 | 249 | var = NIH_MUST (nih_sprintf (NULL, "ACTION=%s", action)); | ||
1319 | 250 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1320 | 251 | } | ||
1321 | 252 | |||
1322 | 253 | for (struct udev_list_entry *list_entry = udev_device_get_properties_list_entry (udev_device); | ||
1323 | 254 | list_entry != NULL; | ||
1324 | 255 | list_entry = udev_list_entry_get_next (list_entry)) { | ||
1325 | 256 | const char * key; | ||
1326 | 257 | nih_local char *var = NULL; | ||
1327 | 258 | |||
1328 | 259 | key = udev_list_entry_get_name (list_entry); | ||
1329 | 260 | if (! strcmp (key, "DEVPATH")) | ||
1330 | 261 | continue; | ||
1331 | 262 | if (! strcmp (key, "DEVNAME")) | ||
1332 | 263 | continue; | ||
1333 | 264 | if (! strcmp (key, "SUBSYSTEM")) | ||
1334 | 265 | continue; | ||
1335 | 266 | if (! strcmp (key, "ACTION")) | ||
1336 | 267 | continue; | ||
1337 | 268 | |||
1338 | 269 | var = NIH_MUST (nih_sprintf (NULL, "%s=%s", key, | ||
1339 | 270 | udev_list_entry_get_value (list_entry))); | ||
1340 | 271 | NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); | ||
1341 | 272 | } | ||
1342 | 273 | |||
1343 | 274 | nih_debug ("%s %s", name, devname); | ||
1344 | 275 | |||
1345 | 276 | pending_call = NIH_SHOULD (upstart_emit_event (upstart, | ||
1346 | 277 | name, env, FALSE, | ||
1347 | 278 | NULL, emit_event_error, NULL, | ||
1348 | 279 | NIH_DBUS_TIMEOUT_NEVER)); | ||
1349 | 280 | if (! pending_call) { | ||
1350 | 281 | NihError *err; | ||
1351 | 282 | |||
1352 | 283 | err = nih_error_get (); | ||
1353 | 284 | nih_warn ("%s", err->message); | ||
1354 | 285 | nih_free (err); | ||
1355 | 286 | } | ||
1356 | 287 | |||
1357 | 288 | dbus_pending_call_unref (pending_call); | ||
1358 | 289 | |||
1359 | 290 | udev_device_unref (udev_device); | ||
1360 | 291 | } | ||
1361 | 292 | |||
1362 | 293 | |||
1363 | 294 | static void | ||
1364 | 295 | upstart_disconnected (DBusConnection *connection) | ||
1365 | 296 | { | ||
1366 | 297 | nih_fatal (_("Disconnected from Upstart")); | ||
1367 | 298 | nih_main_loop_exit (1); | ||
1368 | 299 | } | ||
1369 | 300 | |||
1370 | 301 | static void | ||
1371 | 302 | emit_event_error (void * data, | ||
1372 | 303 | NihDBusMessage *message) | ||
1373 | 304 | { | ||
1374 | 305 | NihError *err; | ||
1375 | 306 | |||
1376 | 307 | err = nih_error_get (); | ||
1377 | 308 | nih_warn ("%s", err->message); | ||
1378 | 309 | nih_free (err); | ||
1379 | 310 | } | ||
1380 | 0 | 311 | ||
1381 | === modified file 'init/control.c' | |||
1382 | --- init/control.c 2009-07-11 11:47:12 +0000 | |||
1383 | +++ init/control.c 2011-05-15 18:31:10 +0000 | |||
1384 | @@ -25,8 +25,10 @@ | |||
1385 | 25 | 25 | ||
1386 | 26 | #include <dbus/dbus.h> | 26 | #include <dbus/dbus.h> |
1387 | 27 | 27 | ||
1388 | 28 | #include <fcntl.h> | ||
1389 | 28 | #include <stdio.h> | 29 | #include <stdio.h> |
1390 | 29 | #include <string.h> | 30 | #include <string.h> |
1391 | 31 | #include <unistd.h> | ||
1392 | 30 | 32 | ||
1393 | 31 | #include <nih/macros.h> | 33 | #include <nih/macros.h> |
1394 | 32 | #include <nih/alloc.h> | 34 | #include <nih/alloc.h> |
1395 | @@ -462,13 +464,24 @@ | |||
1396 | 462 | } | 464 | } |
1397 | 463 | 465 | ||
1398 | 464 | 466 | ||
1399 | 467 | int | ||
1400 | 468 | control_emit_event (void *data, | ||
1401 | 469 | NihDBusMessage *message, | ||
1402 | 470 | const char *name, | ||
1403 | 471 | char * const *env, | ||
1404 | 472 | int wait) | ||
1405 | 473 | { | ||
1406 | 474 | return control_emit_event_with_file (data, message, name, env, wait, -1); | ||
1407 | 475 | } | ||
1408 | 476 | |||
1409 | 465 | /** | 477 | /** |
1411 | 466 | * control_emit_event: | 478 | * control_emit_event_with_file: |
1412 | 467 | * @data: not used, | 479 | * @data: not used, |
1413 | 468 | * @message: D-Bus connection and message received, | 480 | * @message: D-Bus connection and message received, |
1414 | 469 | * @name: name of event to emit, | 481 | * @name: name of event to emit, |
1415 | 470 | * @env: environment of environment, | 482 | * @env: environment of environment, |
1417 | 471 | * @wait: whether to wait for event completion before returning. | 483 | * @wait: whether to wait for event completion before returning, |
1418 | 484 | * @file: file descriptor. | ||
1419 | 472 | * | 485 | * |
1420 | 473 | * Implements the top half of the EmitEvent method of the com.ubuntu.Upstart | 486 | * Implements the top half of the EmitEvent method of the com.ubuntu.Upstart |
1421 | 474 | * interface, the bottom half may be found in event_finished(). | 487 | * interface, the bottom half may be found in event_finished(). |
1422 | @@ -488,11 +501,12 @@ | |||
1423 | 488 | * Returns: zero on success, negative value on raised error. | 501 | * Returns: zero on success, negative value on raised error. |
1424 | 489 | **/ | 502 | **/ |
1425 | 490 | int | 503 | int |
1431 | 491 | control_emit_event (void *data, | 504 | control_emit_event_with_file (void *data, |
1432 | 492 | NihDBusMessage *message, | 505 | NihDBusMessage *message, |
1433 | 493 | const char *name, | 506 | const char *name, |
1434 | 494 | char * const *env, | 507 | char * const *env, |
1435 | 495 | int wait) | 508 | int wait, |
1436 | 509 | int file) | ||
1437 | 496 | { | 510 | { |
1438 | 497 | Event *event; | 511 | Event *event; |
1439 | 498 | Blocked *blocked; | 512 | Blocked *blocked; |
1440 | @@ -505,6 +519,7 @@ | |||
1441 | 505 | if (! strlen (name)) { | 519 | if (! strlen (name)) { |
1442 | 506 | nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, | 520 | nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, |
1443 | 507 | _("Name may not be empty string")); | 521 | _("Name may not be empty string")); |
1444 | 522 | close (file); | ||
1445 | 508 | return -1; | 523 | return -1; |
1446 | 509 | } | 524 | } |
1447 | 510 | 525 | ||
1448 | @@ -512,19 +527,33 @@ | |||
1449 | 512 | if (! environ_all_valid (env)) { | 527 | if (! environ_all_valid (env)) { |
1450 | 513 | nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, | 528 | nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, |
1451 | 514 | _("Env must be KEY=VALUE pairs")); | 529 | _("Env must be KEY=VALUE pairs")); |
1452 | 530 | close (file); | ||
1453 | 515 | return -1; | 531 | return -1; |
1454 | 516 | } | 532 | } |
1455 | 517 | 533 | ||
1456 | 518 | /* Make the event and block the message on it */ | 534 | /* Make the event and block the message on it */ |
1457 | 519 | event = event_new (NULL, name, (char **)env); | 535 | event = event_new (NULL, name, (char **)env); |
1460 | 520 | if (! event) | 536 | if (! event) { |
1461 | 521 | nih_return_system_error (-1); | 537 | nih_error_raise_system (); |
1462 | 538 | close (file); | ||
1463 | 539 | return -1; | ||
1464 | 540 | } | ||
1465 | 541 | |||
1466 | 542 | event->fd = file; | ||
1467 | 543 | if (event->fd >= 0) { | ||
1468 | 544 | long flags; | ||
1469 | 545 | |||
1470 | 546 | flags = fcntl (event->fd, F_GETFD); | ||
1471 | 547 | flags &= ~FD_CLOEXEC; | ||
1472 | 548 | fcntl (event->fd, F_SETFD, flags); | ||
1473 | 549 | } | ||
1474 | 522 | 550 | ||
1475 | 523 | if (wait) { | 551 | if (wait) { |
1476 | 524 | blocked = blocked_new (event, BLOCKED_EMIT_METHOD, message); | 552 | blocked = blocked_new (event, BLOCKED_EMIT_METHOD, message); |
1477 | 525 | if (! blocked) { | 553 | if (! blocked) { |
1478 | 526 | nih_error_raise_system (); | 554 | nih_error_raise_system (); |
1479 | 527 | nih_free (event); | 555 | nih_free (event); |
1480 | 556 | close (file); | ||
1481 | 528 | return -1; | 557 | return -1; |
1482 | 529 | } | 558 | } |
1483 | 530 | 559 | ||
1484 | 531 | 560 | ||
1485 | === modified file 'init/control.h' | |||
1486 | --- init/control.h 2009-07-09 08:36:52 +0000 | |||
1487 | +++ init/control.h 2011-05-15 18:31:10 +0000 | |||
1488 | @@ -60,6 +60,10 @@ | |||
1489 | 60 | const char *name, char * const *env, | 60 | const char *name, char * const *env, |
1490 | 61 | int wait) | 61 | int wait) |
1491 | 62 | __attribute__ ((warn_unused_result)); | 62 | __attribute__ ((warn_unused_result)); |
1492 | 63 | int control_emit_event_with_file (void *data, NihDBusMessage *message, | ||
1493 | 64 | const char *name, char * const *env, | ||
1494 | 65 | int wait, int file) | ||
1495 | 66 | __attribute__ ((warn_unused_result)); | ||
1496 | 63 | 67 | ||
1497 | 64 | int control_get_version (void *data, NihDBusMessage *message, | 68 | int control_get_version (void *data, NihDBusMessage *message, |
1498 | 65 | char **version) | 69 | char **version) |
1499 | 66 | 70 | ||
1500 | === modified file 'init/event.c' | |||
1501 | --- init/event.c 2010-12-14 15:32:41 +0000 | |||
1502 | +++ init/event.c 2011-05-15 18:31:10 +0000 | |||
1503 | @@ -25,6 +25,7 @@ | |||
1504 | 25 | 25 | ||
1505 | 26 | 26 | ||
1506 | 27 | #include <string.h> | 27 | #include <string.h> |
1507 | 28 | #include <unistd.h> | ||
1508 | 28 | 29 | ||
1509 | 29 | #include <nih/macros.h> | 30 | #include <nih/macros.h> |
1510 | 30 | #include <nih/alloc.h> | 31 | #include <nih/alloc.h> |
1511 | @@ -123,6 +124,8 @@ | |||
1512 | 123 | 124 | ||
1513 | 124 | nih_list_init (&event->entry); | 125 | nih_list_init (&event->entry); |
1514 | 125 | 126 | ||
1515 | 127 | event->fd = -1; | ||
1516 | 128 | |||
1517 | 126 | event->progress = EVENT_PENDING; | 129 | event->progress = EVENT_PENDING; |
1518 | 127 | event->failed = FALSE; | 130 | event->failed = FALSE; |
1519 | 128 | 131 | ||
1520 | @@ -393,8 +396,16 @@ | |||
1521 | 393 | job->start_env = env; | 396 | job->start_env = env; |
1522 | 394 | nih_ref (job->start_env, job); | 397 | nih_ref (job->start_env, job); |
1523 | 395 | 398 | ||
1524 | 399 | nih_discard (env); | ||
1525 | 400 | env = NULL; | ||
1526 | 401 | |||
1527 | 396 | job_finished (job, FALSE); | 402 | job_finished (job, FALSE); |
1528 | 397 | 403 | ||
1529 | 404 | NIH_MUST (event_operator_fds (class->start_on, job, | ||
1530 | 405 | &job->fds, &job->num_fds, | ||
1531 | 406 | &job->start_env, &len, | ||
1532 | 407 | "UPSTART_FDS")); | ||
1533 | 408 | |||
1534 | 398 | event_operator_events (job->class->start_on, | 409 | event_operator_events (job->class->start_on, |
1535 | 399 | job, &job->blocking); | 410 | job, &job->blocking); |
1536 | 400 | 411 | ||
1537 | @@ -459,6 +470,8 @@ | |||
1538 | 459 | nih_free (blocked); | 470 | nih_free (blocked); |
1539 | 460 | } | 471 | } |
1540 | 461 | 472 | ||
1541 | 473 | close (event->fd); | ||
1542 | 474 | |||
1543 | 462 | if (event->failed) { | 475 | if (event->failed) { |
1544 | 463 | char *name; | 476 | char *name; |
1545 | 464 | 477 | ||
1546 | 465 | 478 | ||
1547 | === modified file 'init/event.h' | |||
1548 | --- init/event.h 2009-07-09 08:36:52 +0000 | |||
1549 | +++ init/event.h 2011-05-15 18:31:10 +0000 | |||
1550 | @@ -63,6 +63,7 @@ | |||
1551 | 63 | 63 | ||
1552 | 64 | char *name; | 64 | char *name; |
1553 | 65 | char **env; | 65 | char **env; |
1554 | 66 | int fd; | ||
1555 | 66 | 67 | ||
1556 | 67 | EventProgress progress; | 68 | EventProgress progress; |
1557 | 68 | int failed; | 69 | int failed; |
1558 | 69 | 70 | ||
1559 | === modified file 'init/event_operator.c' | |||
1560 | --- init/event_operator.c 2010-11-19 14:34:51 +0000 | |||
1561 | +++ init/event_operator.c 2011-05-15 18:31:10 +0000 | |||
1562 | @@ -552,6 +552,65 @@ | |||
1563 | 552 | return *env; | 552 | return *env; |
1564 | 553 | } | 553 | } |
1565 | 554 | 554 | ||
1566 | 555 | int * | ||
1567 | 556 | event_operator_fds (EventOperator *root, | ||
1568 | 557 | const void *parent, | ||
1569 | 558 | int **fds, | ||
1570 | 559 | size_t *num_fds, | ||
1571 | 560 | char ***env, | ||
1572 | 561 | size_t *len, | ||
1573 | 562 | const char *key) | ||
1574 | 563 | { | ||
1575 | 564 | nih_local char *evlist = NULL; | ||
1576 | 565 | |||
1577 | 566 | nih_assert (root != NULL); | ||
1578 | 567 | nih_assert (fds != NULL); | ||
1579 | 568 | nih_assert (num_fds != NULL); | ||
1580 | 569 | nih_assert (env != NULL); | ||
1581 | 570 | nih_assert (len != NULL); | ||
1582 | 571 | nih_assert (key != NULL); | ||
1583 | 572 | |||
1584 | 573 | /* Initialise the event list variable with the name given. */ | ||
1585 | 574 | evlist = nih_sprintf (NULL, "%s=", key); | ||
1586 | 575 | if (! evlist) | ||
1587 | 576 | return NULL; | ||
1588 | 577 | |||
1589 | 578 | *num_fds = 0; | ||
1590 | 579 | NIH_TREE_FOREACH_FULL (&root->node, iter, | ||
1591 | 580 | (NihTreeFilter)event_operator_filter, NULL) { | ||
1592 | 581 | EventOperator *oper = (EventOperator *)iter; | ||
1593 | 582 | |||
1594 | 583 | if (oper->type != EVENT_MATCH) | ||
1595 | 584 | continue; | ||
1596 | 585 | |||
1597 | 586 | nih_assert (oper->event != NULL); | ||
1598 | 587 | |||
1599 | 588 | if (oper->event->fd >= 0) { | ||
1600 | 589 | *fds = nih_realloc (*fds, parent, sizeof (int) * (*num_fds + 1)); | ||
1601 | 590 | if (! *fds) | ||
1602 | 591 | return NULL; | ||
1603 | 592 | |||
1604 | 593 | (*fds)[(*num_fds)++] = oper->event->fd; | ||
1605 | 594 | |||
1606 | 595 | if (evlist[strlen (evlist) - 1] != '=') { | ||
1607 | 596 | if (! nih_strcat_sprintf (&evlist, NULL, " %d", | ||
1608 | 597 | oper->event->fd)) | ||
1609 | 598 | return NULL; | ||
1610 | 599 | } else { | ||
1611 | 600 | if (! nih_strcat_sprintf (&evlist, NULL, "%d", | ||
1612 | 601 | oper->event->fd)) | ||
1613 | 602 | return NULL; | ||
1614 | 603 | } | ||
1615 | 604 | } | ||
1616 | 605 | } | ||
1617 | 606 | |||
1618 | 607 | if (*num_fds) | ||
1619 | 608 | if (! environ_add (env, parent, len, TRUE, evlist)) | ||
1620 | 609 | return NULL; | ||
1621 | 610 | |||
1622 | 611 | return (void *)1; | ||
1623 | 612 | } | ||
1624 | 613 | |||
1625 | 555 | /** | 614 | /** |
1626 | 556 | * event_operator_events: | 615 | * event_operator_events: |
1627 | 557 | * @root: operator tree to collect from, | 616 | * @root: operator tree to collect from, |
1628 | 558 | 617 | ||
1629 | === modified file 'init/event_operator.h' | |||
1630 | --- init/event_operator.h 2009-06-23 09:29:35 +0000 | |||
1631 | +++ init/event_operator.h 2011-05-15 18:31:10 +0000 | |||
1632 | @@ -95,6 +95,14 @@ | |||
1633 | 95 | char ** event_operator_environment (EventOperator *root, char ***env, | 95 | char ** event_operator_environment (EventOperator *root, char ***env, |
1634 | 96 | const void *parent, size_t *len, | 96 | const void *parent, size_t *len, |
1635 | 97 | const char *key); | 97 | const char *key); |
1636 | 98 | int * | ||
1637 | 99 | event_operator_fds (EventOperator *root, | ||
1638 | 100 | const void *parent, | ||
1639 | 101 | int **fds, | ||
1640 | 102 | size_t *num_fds, | ||
1641 | 103 | char ***env, | ||
1642 | 104 | size_t *len, | ||
1643 | 105 | const char *key); | ||
1644 | 98 | void event_operator_events (EventOperator *root, | 106 | void event_operator_events (EventOperator *root, |
1645 | 99 | const void *parent, NihList *list); | 107 | const void *parent, NihList *list); |
1646 | 100 | 108 | ||
1647 | 101 | 109 | ||
1648 | === modified file 'init/job.c' | |||
1649 | --- init/job.c 2010-12-14 15:32:41 +0000 | |||
1650 | +++ init/job.c 2011-05-15 18:31:10 +0000 | |||
1651 | @@ -118,6 +118,9 @@ | |||
1652 | 118 | goto error; | 118 | goto error; |
1653 | 119 | } | 119 | } |
1654 | 120 | 120 | ||
1655 | 121 | job->fds = NULL; | ||
1656 | 122 | job->num_fds = 0; | ||
1657 | 123 | |||
1658 | 121 | job->pid = nih_alloc (job, sizeof (pid_t) * PROCESS_LAST); | 124 | job->pid = nih_alloc (job, sizeof (pid_t) * PROCESS_LAST); |
1659 | 122 | if (! job->pid) | 125 | if (! job->pid) |
1660 | 123 | goto error; | 126 | goto error; |
1661 | 124 | 127 | ||
1662 | === modified file 'init/job.h' | |||
1663 | --- init/job.h 2009-07-03 16:38:02 +0000 | |||
1664 | +++ init/job.h 2011-05-15 18:31:10 +0000 | |||
1665 | @@ -134,6 +134,9 @@ | |||
1666 | 134 | char **stop_env; | 134 | char **stop_env; |
1667 | 135 | EventOperator *stop_on; | 135 | EventOperator *stop_on; |
1668 | 136 | 136 | ||
1669 | 137 | int *fds; | ||
1670 | 138 | size_t num_fds; | ||
1671 | 139 | |||
1672 | 137 | pid_t *pid; | 140 | pid_t *pid; |
1673 | 138 | Event *blocker; | 141 | Event *blocker; |
1674 | 139 | NihList blocking; | 142 | NihList blocking; |
1675 | 140 | 143 | ||
1676 | === modified file 'po/POTFILES.in' | |||
1677 | --- po/POTFILES.in 2011-05-05 09:06:21 +0000 | |||
1678 | +++ po/POTFILES.in 2011-05-15 18:31:10 +0000 | |||
1679 | @@ -20,3 +20,5 @@ | |||
1680 | 20 | util/runlevel.c | 20 | util/runlevel.c |
1681 | 21 | util/shutdown.c | 21 | util/shutdown.c |
1682 | 22 | util/telinit.c | 22 | util/telinit.c |
1683 | 23 | |||
1684 | 24 | extra/upstart-udev-bridge.c | ||
1685 | 23 | 25 | ||
1686 | === modified file 'po/upstart.pot' | |||
1687 | --- po/upstart.pot 2011-03-22 17:52:25 +0000 | |||
1688 | +++ po/upstart.pot 2011-05-15 18:31:10 +0000 | |||
1689 | @@ -6,12 +6,13 @@ | |||
1690 | 6 | #, fuzzy | 6 | #, fuzzy |
1691 | 7 | msgid "" | 7 | msgid "" |
1692 | 8 | msgstr "" | 8 | msgstr "" |
1694 | 9 | "Project-Id-Version: upstart 1.2\n" | 9 | "Project-Id-Version: upstart 1.3\n" |
1695 | 10 | "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" | 10 | "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" |
1697 | 11 | "POT-Creation-Date: 2011-03-22 10:52-0700\n" | 11 | "POT-Creation-Date: 2011-05-15 15:48+0100\n" |
1698 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1699 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1700 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1701 | 15 | "Language: \n" | ||
1702 | 15 | "MIME-Version: 1.0\n" | 16 | "MIME-Version: 1.0\n" |
1703 | 16 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
1704 | 17 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
1705 | @@ -46,305 +47,364 @@ | |||
1706 | 46 | msgid "Configuration directory deleted" | 47 | msgid "Configuration directory deleted" |
1707 | 47 | msgstr "" | 48 | msgstr "" |
1708 | 48 | 49 | ||
1710 | 49 | #: init/control.c:155 | 50 | #: init/control.c:157 |
1711 | 50 | msgid "Connection from private client" | 51 | msgid "Connection from private client" |
1712 | 51 | msgstr "" | 52 | msgstr "" |
1713 | 52 | 53 | ||
1715 | 53 | #: init/control.c:290 | 54 | #: init/control.c:292 |
1716 | 54 | msgid "Disconnected from system bus" | 55 | msgid "Disconnected from system bus" |
1717 | 55 | msgstr "" | 56 | msgstr "" |
1718 | 56 | 57 | ||
1720 | 57 | #: init/control.c:356 init/main.c:546 | 58 | #: init/control.c:358 init/main.c:546 |
1721 | 58 | msgid "Reloading configuration" | 59 | msgid "Reloading configuration" |
1722 | 59 | msgstr "" | 60 | msgstr "" |
1723 | 60 | 61 | ||
1725 | 61 | #: init/control.c:396 init/control.c:507 | 62 | #: init/control.c:398 init/control.c:521 |
1726 | 62 | msgid "Name may not be empty string" | 63 | msgid "Name may not be empty string" |
1727 | 63 | msgstr "" | 64 | msgstr "" |
1728 | 64 | 65 | ||
1730 | 65 | #: init/control.c:405 | 66 | #: init/control.c:407 |
1731 | 66 | #, c-format | 67 | #, c-format |
1732 | 67 | msgid "Unknown job: %s" | 68 | msgid "Unknown job: %s" |
1733 | 68 | msgstr "" | 69 | msgstr "" |
1734 | 69 | 70 | ||
1737 | 70 | #: init/control.c:514 init/job_class.c:522 init/job_class.c:710 | 71 | #: init/control.c:529 init/job_class.c:524 init/job_class.c:712 |
1738 | 71 | #: init/job_class.c:829 init/job_class.c:953 | 72 | #: init/job_class.c:831 init/job_class.c:955 |
1739 | 72 | msgid "Env must be KEY=VALUE pairs" | 73 | msgid "Env must be KEY=VALUE pairs" |
1740 | 73 | msgstr "" | 74 | msgstr "" |
1741 | 74 | 75 | ||
1743 | 75 | #: init/control.c:666 | 76 | #: init/control.c:695 |
1744 | 76 | msgid "The log priority given was not recognised" | 77 | msgid "The log priority given was not recognised" |
1745 | 77 | msgstr "" | 78 | msgstr "" |
1746 | 78 | 79 | ||
1748 | 79 | #: init/event.c:273 | 80 | #: init/errors.h:58 |
1749 | 81 | msgid "Illegal parameter" | ||
1750 | 82 | msgstr "" | ||
1751 | 83 | |||
1752 | 84 | #: init/errors.h:59 | ||
1753 | 85 | msgid "Unknown parameter" | ||
1754 | 86 | msgstr "" | ||
1755 | 87 | |||
1756 | 88 | #: init/errors.h:60 init/errors.h:71 | ||
1757 | 89 | msgid "Expected operator" | ||
1758 | 90 | msgstr "" | ||
1759 | 91 | |||
1760 | 92 | #: init/errors.h:61 | ||
1761 | 93 | msgid "Mismatched braces" | ||
1762 | 94 | msgstr "" | ||
1763 | 95 | |||
1764 | 96 | #: init/errors.h:62 | ||
1765 | 97 | msgid "Illegal interval, expected number of seconds" | ||
1766 | 98 | msgstr "" | ||
1767 | 99 | |||
1768 | 100 | #: init/errors.h:63 | ||
1769 | 101 | msgid "Illegal exit status, expected integer" | ||
1770 | 102 | msgstr "" | ||
1771 | 103 | |||
1772 | 104 | #: init/errors.h:64 | ||
1773 | 105 | msgid "Illegal signal status, expected integer" | ||
1774 | 106 | msgstr "" | ||
1775 | 107 | |||
1776 | 108 | #: init/errors.h:65 | ||
1777 | 109 | msgid "Illegal file creation mask, expected octal integer" | ||
1778 | 110 | msgstr "" | ||
1779 | 111 | |||
1780 | 112 | #: init/errors.h:66 | ||
1781 | 113 | msgid "Illegal nice value, expected -20 to 19" | ||
1782 | 114 | msgstr "" | ||
1783 | 115 | |||
1784 | 116 | #: init/errors.h:67 | ||
1785 | 117 | msgid "Illegal oom adjustment, expected -16 to 15 or 'never'" | ||
1786 | 118 | msgstr "" | ||
1787 | 119 | |||
1788 | 120 | #: init/errors.h:68 | ||
1789 | 121 | msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'" | ||
1790 | 122 | msgstr "" | ||
1791 | 123 | |||
1792 | 124 | #: init/errors.h:69 | ||
1793 | 125 | msgid "Illegal limit, expected 'unlimited' or integer" | ||
1794 | 126 | msgstr "" | ||
1795 | 127 | |||
1796 | 128 | #: init/errors.h:70 | ||
1797 | 129 | msgid "Expected event" | ||
1798 | 130 | msgstr "" | ||
1799 | 131 | |||
1800 | 132 | #: init/errors.h:72 | ||
1801 | 133 | msgid "Expected variable name before value" | ||
1802 | 134 | msgstr "" | ||
1803 | 135 | |||
1804 | 136 | #: init/errors.h:73 | ||
1805 | 137 | msgid "Mismatched parentheses" | ||
1806 | 138 | msgstr "" | ||
1807 | 139 | |||
1808 | 140 | #: init/errors.h:74 | ||
1809 | 141 | msgid "Name already taken" | ||
1810 | 142 | msgstr "" | ||
1811 | 143 | |||
1812 | 144 | #: init/event.c:276 | ||
1813 | 80 | #, c-format | 145 | #, c-format |
1814 | 81 | msgid "Handling %s event" | 146 | msgid "Handling %s event" |
1815 | 82 | msgstr "" | 147 | msgstr "" |
1816 | 83 | 148 | ||
1818 | 84 | #: init/event.c:373 | 149 | #: init/event.c:376 |
1819 | 85 | #, c-format | 150 | #, c-format |
1820 | 86 | msgid "Failed to obtain %s instance: %s" | 151 | msgid "Failed to obtain %s instance: %s" |
1821 | 87 | msgstr "" | 152 | msgstr "" |
1822 | 88 | 153 | ||
1824 | 89 | #: init/event.c:448 | 154 | #: init/event.c:459 |
1825 | 90 | msgid "Event failed" | 155 | msgid "Event failed" |
1826 | 91 | msgstr "" | 156 | msgstr "" |
1827 | 92 | 157 | ||
1829 | 93 | #: init/job.c:223 | 158 | #: init/job.c:226 |
1830 | 94 | #, c-format | 159 | #, c-format |
1831 | 95 | msgid "%s goal changed from %s to %s" | 160 | msgid "%s goal changed from %s to %s" |
1832 | 96 | msgstr "" | 161 | msgstr "" |
1833 | 97 | 162 | ||
1835 | 98 | #: init/job.c:294 | 163 | #: init/job.c:297 |
1836 | 99 | #, c-format | 164 | #, c-format |
1837 | 100 | msgid "%s state changed from %s to %s" | 165 | msgid "%s state changed from %s to %s" |
1838 | 101 | msgstr "" | 166 | msgstr "" |
1839 | 102 | 167 | ||
1841 | 103 | #: init/job.c:713 init/job.c:751 | 168 | #: init/job.c:716 init/job.c:754 |
1842 | 104 | msgid "Job failed to start" | 169 | msgid "Job failed to start" |
1843 | 105 | msgstr "" | 170 | msgstr "" |
1844 | 106 | 171 | ||
1846 | 107 | #: init/job.c:726 init/job.c:762 | 172 | #: init/job.c:729 init/job.c:765 |
1847 | 108 | msgid "Job failed while stopping" | 173 | msgid "Job failed while stopping" |
1848 | 109 | msgstr "" | 174 | msgstr "" |
1849 | 110 | 175 | ||
1851 | 111 | #: init/job.c:738 init/job.c:773 | 176 | #: init/job.c:741 init/job.c:776 |
1852 | 112 | msgid "Job failed to restart" | 177 | msgid "Job failed to restart" |
1853 | 113 | msgstr "" | 178 | msgstr "" |
1854 | 114 | 179 | ||
1856 | 115 | #: init/job.c:966 | 180 | #: init/job.c:969 |
1857 | 116 | msgid "stop" | 181 | msgid "stop" |
1858 | 117 | msgstr "" | 182 | msgstr "" |
1859 | 118 | 183 | ||
1861 | 119 | #: init/job.c:968 | 184 | #: init/job.c:971 |
1862 | 120 | msgid "start" | 185 | msgid "start" |
1863 | 121 | msgstr "" | 186 | msgstr "" |
1864 | 122 | 187 | ||
1866 | 123 | #: init/job.c:970 | 188 | #: init/job.c:973 |
1867 | 124 | msgid "respawn" | 189 | msgid "respawn" |
1868 | 125 | msgstr "" | 190 | msgstr "" |
1869 | 126 | 191 | ||
1871 | 127 | #: init/job.c:1015 | 192 | #: init/job.c:1018 |
1872 | 128 | msgid "waiting" | 193 | msgid "waiting" |
1873 | 129 | msgstr "" | 194 | msgstr "" |
1874 | 130 | 195 | ||
1876 | 131 | #: init/job.c:1017 | 196 | #: init/job.c:1020 |
1877 | 132 | msgid "starting" | 197 | msgid "starting" |
1878 | 133 | msgstr "" | 198 | msgstr "" |
1879 | 134 | 199 | ||
1881 | 135 | #: init/job.c:1019 init/process.c:80 | 200 | #: init/job.c:1022 init/process.c:80 |
1882 | 136 | msgid "pre-start" | 201 | msgid "pre-start" |
1883 | 137 | msgstr "" | 202 | msgstr "" |
1884 | 138 | 203 | ||
1886 | 139 | #: init/job.c:1021 | 204 | #: init/job.c:1024 |
1887 | 140 | msgid "spawned" | 205 | msgid "spawned" |
1888 | 141 | msgstr "" | 206 | msgstr "" |
1889 | 142 | 207 | ||
1891 | 143 | #: init/job.c:1023 init/process.c:82 | 208 | #: init/job.c:1026 init/process.c:82 |
1892 | 144 | msgid "post-start" | 209 | msgid "post-start" |
1893 | 145 | msgstr "" | 210 | msgstr "" |
1894 | 146 | 211 | ||
1896 | 147 | #: init/job.c:1025 | 212 | #: init/job.c:1028 |
1897 | 148 | msgid "running" | 213 | msgid "running" |
1898 | 149 | msgstr "" | 214 | msgstr "" |
1899 | 150 | 215 | ||
1901 | 151 | #: init/job.c:1027 init/process.c:84 | 216 | #: init/job.c:1030 init/process.c:84 |
1902 | 152 | msgid "pre-stop" | 217 | msgid "pre-stop" |
1903 | 153 | msgstr "" | 218 | msgstr "" |
1904 | 154 | 219 | ||
1906 | 155 | #: init/job.c:1029 | 220 | #: init/job.c:1032 |
1907 | 156 | msgid "stopping" | 221 | msgid "stopping" |
1908 | 157 | msgstr "" | 222 | msgstr "" |
1909 | 158 | 223 | ||
1911 | 159 | #: init/job.c:1031 | 224 | #: init/job.c:1034 |
1912 | 160 | msgid "killed" | 225 | msgid "killed" |
1913 | 161 | msgstr "" | 226 | msgstr "" |
1914 | 162 | 227 | ||
1916 | 163 | #: init/job.c:1033 init/process.c:86 | 228 | #: init/job.c:1036 init/process.c:86 |
1917 | 164 | msgid "post-stop" | 229 | msgid "post-stop" |
1918 | 165 | msgstr "" | 230 | msgstr "" |
1919 | 166 | 231 | ||
1921 | 167 | #: init/job.c:1113 init/job_class.c:756 | 232 | #: init/job.c:1116 init/job_class.c:758 |
1922 | 168 | #, c-format | 233 | #, c-format |
1923 | 169 | msgid "Job is already running: %s" | 234 | msgid "Job is already running: %s" |
1924 | 170 | msgstr "" | 235 | msgstr "" |
1925 | 171 | 236 | ||
1927 | 172 | #: init/job.c:1177 init/job.c:1242 init/job_class.c:875 init/job_class.c:998 | 237 | #: init/job.c:1180 init/job.c:1245 init/job_class.c:877 init/job_class.c:1000 |
1928 | 173 | #, c-format | 238 | #, c-format |
1929 | 174 | msgid "Job has already been stopped: %s" | 239 | msgid "Job has already been stopped: %s" |
1930 | 175 | msgstr "" | 240 | msgstr "" |
1931 | 176 | 241 | ||
1934 | 177 | #: init/job_class.c:559 init/job_class.c:604 init/job_class.c:867 | 242 | #: init/job_class.c:561 init/job_class.c:606 init/job_class.c:869 |
1935 | 178 | #: init/job_class.c:990 | 243 | #: init/job_class.c:992 |
1936 | 179 | #, c-format | 244 | #, c-format |
1937 | 180 | msgid "Unknown instance: %s" | 245 | msgid "Unknown instance: %s" |
1938 | 181 | msgstr "" | 246 | msgstr "" |
1939 | 182 | 247 | ||
1941 | 183 | #: init/job_process.c:279 | 248 | #: init/job_process.c:277 |
1942 | 184 | #, c-format | 249 | #, c-format |
1943 | 185 | msgid "Failed to spawn %s %s process: %s" | 250 | msgid "Failed to spawn %s %s process: %s" |
1944 | 186 | msgstr "" | 251 | msgstr "" |
1945 | 187 | 252 | ||
1947 | 188 | #: init/job_process.c:285 | 253 | #: init/job_process.c:283 |
1948 | 189 | msgid "Temporary process spawn error" | 254 | msgid "Temporary process spawn error" |
1949 | 190 | msgstr "" | 255 | msgstr "" |
1950 | 191 | 256 | ||
1952 | 192 | #: init/job_process.c:292 | 257 | #: init/job_process.c:290 |
1953 | 193 | #, c-format | 258 | #, c-format |
1954 | 194 | msgid "%s %s process (%d)" | 259 | msgid "%s %s process (%d)" |
1955 | 195 | msgstr "" | 260 | msgstr "" |
1956 | 196 | 261 | ||
1958 | 197 | #: init/job_process.c:399 | 262 | #: init/job_process.c:403 |
1959 | 198 | #, c-format | 263 | #, c-format |
1960 | 199 | msgid "Pausing %s (%d) [pre-exec] for debug" | 264 | msgid "Pausing %s (%d) [pre-exec] for debug" |
1961 | 200 | msgstr "" | 265 | msgstr "" |
1962 | 201 | 266 | ||
1964 | 202 | #: init/job_process.c:453 | 267 | #: init/job_process.c:473 |
1965 | 203 | #, c-format | 268 | #, c-format |
1966 | 204 | msgid "Failed to open system console: %s" | 269 | msgid "Failed to open system console: %s" |
1967 | 205 | msgstr "" | 270 | msgstr "" |
1968 | 206 | 271 | ||
1970 | 207 | #: init/job_process.c:669 | 272 | #: init/job_process.c:697 |
1971 | 273 | #, c-format | ||
1972 | 274 | msgid "unable to move script fd: %s" | ||
1973 | 275 | msgstr "" | ||
1974 | 276 | |||
1975 | 277 | #: init/job_process.c:702 | ||
1976 | 208 | #, c-format | 278 | #, c-format |
1977 | 209 | msgid "unable to open console: %s" | 279 | msgid "unable to open console: %s" |
1978 | 210 | msgstr "" | 280 | msgstr "" |
1979 | 211 | 281 | ||
1981 | 212 | #: init/job_process.c:724 | 282 | #: init/job_process.c:757 |
1982 | 213 | #, c-format | 283 | #, c-format |
1983 | 214 | msgid "unable to set \"%s\" resource limit: %s" | 284 | msgid "unable to set \"%s\" resource limit: %s" |
1984 | 215 | msgstr "" | 285 | msgstr "" |
1985 | 216 | 286 | ||
1987 | 217 | #: init/job_process.c:729 | 287 | #: init/job_process.c:762 |
1988 | 218 | #, c-format | 288 | #, c-format |
1989 | 219 | msgid "unable to set priority: %s" | 289 | msgid "unable to set priority: %s" |
1990 | 220 | msgstr "" | 290 | msgstr "" |
1991 | 221 | 291 | ||
1993 | 222 | #: init/job_process.c:734 | 292 | #: init/job_process.c:767 |
1994 | 223 | #, c-format | 293 | #, c-format |
1995 | 224 | msgid "unable to set oom adjustment: %s" | 294 | msgid "unable to set oom adjustment: %s" |
1996 | 225 | msgstr "" | 295 | msgstr "" |
1997 | 226 | 296 | ||
1999 | 227 | #: init/job_process.c:739 | 297 | #: init/job_process.c:772 |
2000 | 228 | #, c-format | 298 | #, c-format |
2001 | 229 | msgid "unable to change root directory: %s" | 299 | msgid "unable to change root directory: %s" |
2002 | 230 | msgstr "" | 300 | msgstr "" |
2003 | 231 | 301 | ||
2005 | 232 | #: init/job_process.c:744 | 302 | #: init/job_process.c:777 |
2006 | 233 | #, c-format | 303 | #, c-format |
2007 | 234 | msgid "unable to change working directory: %s" | 304 | msgid "unable to change working directory: %s" |
2008 | 235 | msgstr "" | 305 | msgstr "" |
2009 | 236 | 306 | ||
2011 | 237 | #: init/job_process.c:749 | 307 | #: init/job_process.c:782 |
2012 | 238 | #, c-format | 308 | #, c-format |
2013 | 239 | msgid "unable to set trace: %s" | 309 | msgid "unable to set trace: %s" |
2014 | 240 | msgstr "" | 310 | msgstr "" |
2015 | 241 | 311 | ||
2017 | 242 | #: init/job_process.c:754 | 312 | #: init/job_process.c:787 |
2018 | 243 | #, c-format | 313 | #, c-format |
2019 | 244 | msgid "unable to execute: %s" | 314 | msgid "unable to execute: %s" |
2020 | 245 | msgstr "" | 315 | msgstr "" |
2021 | 246 | 316 | ||
2043 | 247 | #: init/job_process.c:785 | 317 | #: init/job_process.c:818 init/job_process.c:868 |
2044 | 248 | #, c-format | 318 | #, c-format |
2045 | 249 | msgid "Sending TERM signal to %s %s process (%d)" | 319 | msgid "Sending %s signal to %s %s process (%d)" |
2046 | 250 | msgstr "" | 320 | msgstr "" |
2047 | 251 | 321 | ||
2048 | 252 | #: init/job_process.c:793 | 322 | #: init/job_process.c:827 init/job_process.c:877 |
2049 | 253 | #, c-format | 323 | #, c-format |
2050 | 254 | msgid "Failed to send TERM signal to %s %s process (%d): %s" | 324 | msgid "Failed to send %s signal to %s %s process (%d): %s" |
2051 | 255 | msgstr "" | 325 | msgstr "" |
2052 | 256 | 326 | ||
2053 | 257 | #: init/job_process.c:833 | 327 | #: init/job_process.c:938 |
2033 | 258 | #, c-format | ||
2034 | 259 | msgid "Sending KILL signal to %s %s process (%d)" | ||
2035 | 260 | msgstr "" | ||
2036 | 261 | |||
2037 | 262 | #: init/job_process.c:841 | ||
2038 | 263 | #, c-format | ||
2039 | 264 | msgid "Failed to send KILL signal to %s %s process (%d): %s" | ||
2040 | 265 | msgstr "" | ||
2041 | 266 | |||
2042 | 267 | #: init/job_process.c:901 | ||
2054 | 268 | #, c-format | 328 | #, c-format |
2055 | 269 | msgid "%s %s process (%d) terminated with status %d" | 329 | msgid "%s %s process (%d) terminated with status %d" |
2056 | 270 | msgstr "" | 330 | msgstr "" |
2057 | 271 | 331 | ||
2059 | 272 | #: init/job_process.c:906 | 332 | #: init/job_process.c:943 |
2060 | 273 | #, c-format | 333 | #, c-format |
2061 | 274 | msgid "%s %s process (%d) exited normally" | 334 | msgid "%s %s process (%d) exited normally" |
2062 | 275 | msgstr "" | 335 | msgstr "" |
2063 | 276 | 336 | ||
2065 | 277 | #: init/job_process.c:921 | 337 | #: init/job_process.c:958 |
2066 | 278 | #, c-format | 338 | #, c-format |
2067 | 279 | msgid "%s %s process (%d) killed by %s signal" | 339 | msgid "%s %s process (%d) killed by %s signal" |
2068 | 280 | msgstr "" | 340 | msgstr "" |
2069 | 281 | 341 | ||
2071 | 282 | #: init/job_process.c:925 | 342 | #: init/job_process.c:962 |
2072 | 283 | #, c-format | 343 | #, c-format |
2073 | 284 | msgid "%s %s process (%d) killed by signal %d" | 344 | msgid "%s %s process (%d) killed by signal %d" |
2074 | 285 | msgstr "" | 345 | msgstr "" |
2075 | 286 | 346 | ||
2077 | 287 | #: init/job_process.c:939 | 347 | #: init/job_process.c:976 |
2078 | 288 | #, c-format | 348 | #, c-format |
2079 | 289 | msgid "%s %s process (%d) stopped by %s signal" | 349 | msgid "%s %s process (%d) stopped by %s signal" |
2080 | 290 | msgstr "" | 350 | msgstr "" |
2081 | 291 | 351 | ||
2083 | 292 | #: init/job_process.c:943 | 352 | #: init/job_process.c:980 |
2084 | 293 | #, c-format | 353 | #, c-format |
2085 | 294 | msgid "%s %s process (%d) stopped by signal %d" | 354 | msgid "%s %s process (%d) stopped by signal %d" |
2086 | 295 | msgstr "" | 355 | msgstr "" |
2087 | 296 | 356 | ||
2089 | 297 | #: init/job_process.c:957 | 357 | #: init/job_process.c:994 |
2090 | 298 | #, c-format | 358 | #, c-format |
2091 | 299 | msgid "%s %s process (%d) continued by %s signal" | 359 | msgid "%s %s process (%d) continued by %s signal" |
2092 | 300 | msgstr "" | 360 | msgstr "" |
2093 | 301 | 361 | ||
2095 | 302 | #: init/job_process.c:961 | 362 | #: init/job_process.c:998 |
2096 | 303 | #, c-format | 363 | #, c-format |
2097 | 304 | msgid "%s %s process (%d) continued by signal %d" | 364 | msgid "%s %s process (%d) continued by signal %d" |
2098 | 305 | msgstr "" | 365 | msgstr "" |
2099 | 306 | 366 | ||
2101 | 307 | #: init/job_process.c:1096 | 367 | #: init/job_process.c:1133 |
2102 | 308 | #, c-format | 368 | #, c-format |
2103 | 309 | msgid "%s respawning too fast, stopped" | 369 | msgid "%s respawning too fast, stopped" |
2104 | 310 | msgstr "" | 370 | msgstr "" |
2105 | 311 | 371 | ||
2107 | 312 | #: init/job_process.c:1102 | 372 | #: init/job_process.c:1139 |
2108 | 313 | #, c-format | 373 | #, c-format |
2109 | 314 | msgid "%s %s process ended, respawning" | 374 | msgid "%s %s process ended, respawning" |
2110 | 315 | msgstr "" | 375 | msgstr "" |
2111 | 316 | 376 | ||
2113 | 317 | #: init/job_process.c:1342 | 377 | #: init/job_process.c:1379 |
2114 | 318 | #, c-format | 378 | #, c-format |
2115 | 319 | msgid "Failed to set ptrace options for %s %s process (%d): %s" | 379 | msgid "Failed to set ptrace options for %s %s process (%d): %s" |
2116 | 320 | msgstr "" | 380 | msgstr "" |
2117 | 321 | 381 | ||
2119 | 322 | #: init/job_process.c:1355 init/job_process.c:1550 | 382 | #: init/job_process.c:1392 init/job_process.c:1587 |
2120 | 323 | #, c-format | 383 | #, c-format |
2121 | 324 | msgid "Failed to continue traced %s %s process (%d): %s" | 384 | msgid "Failed to continue traced %s %s process (%d): %s" |
2122 | 325 | msgstr "" | 385 | msgstr "" |
2123 | 326 | 386 | ||
2125 | 327 | #: init/job_process.c:1395 init/job_process.c:1486 init/job_process.c:1541 | 387 | #: init/job_process.c:1432 init/job_process.c:1523 init/job_process.c:1578 |
2126 | 328 | #, c-format | 388 | #, c-format |
2127 | 329 | msgid "Failed to detach traced %s %s process (%d): %s" | 389 | msgid "Failed to detach traced %s %s process (%d): %s" |
2128 | 330 | msgstr "" | 390 | msgstr "" |
2129 | 331 | 391 | ||
2131 | 332 | #: init/job_process.c:1435 | 392 | #: init/job_process.c:1472 |
2132 | 333 | #, c-format | 393 | #, c-format |
2133 | 334 | msgid "Failed to deliver signal to traced %s %s process (%d): %s" | 394 | msgid "Failed to deliver signal to traced %s %s process (%d): %s" |
2134 | 335 | msgstr "" | 395 | msgstr "" |
2135 | 336 | 396 | ||
2137 | 337 | #: init/job_process.c:1470 | 397 | #: init/job_process.c:1507 |
2138 | 338 | #, c-format | 398 | #, c-format |
2139 | 339 | msgid "Failed to obtain child process id for %s %s process (%d): %s" | 399 | msgid "Failed to obtain child process id for %s %s process (%d): %s" |
2140 | 340 | msgstr "" | 400 | msgstr "" |
2141 | 341 | 401 | ||
2143 | 342 | #: init/job_process.c:1477 | 402 | #: init/job_process.c:1514 |
2144 | 343 | #, c-format | 403 | #, c-format |
2145 | 344 | msgid "%s %s process (%d) became new process (%d)" | 404 | msgid "%s %s process (%d) became new process (%d)" |
2146 | 345 | msgstr "" | 405 | msgstr "" |
2147 | 346 | 406 | ||
2149 | 347 | #: init/job_process.c:1536 | 407 | #: init/job_process.c:1573 |
2150 | 348 | #, c-format | 408 | #, c-format |
2151 | 349 | msgid "%s %s process (%d) executable changed" | 409 | msgid "%s %s process (%d) executable changed" |
2152 | 350 | msgstr "" | 410 | msgstr "" |
2153 | @@ -819,3 +879,33 @@ | |||
2154 | 819 | #, c-format | 879 | #, c-format |
2155 | 820 | msgid "%s: illegal runlevel: %s\n" | 880 | msgid "%s: illegal runlevel: %s\n" |
2156 | 821 | msgstr "" | 881 | msgstr "" |
2157 | 882 | |||
2158 | 883 | #: extra/upstart-udev-bridge.c:76 | ||
2159 | 884 | msgid "Detach and run in the background" | ||
2160 | 885 | msgstr "" | ||
2161 | 886 | |||
2162 | 887 | #: extra/upstart-udev-bridge.c:95 | ||
2163 | 888 | msgid "Bridge udev events into upstart" | ||
2164 | 889 | msgstr "" | ||
2165 | 890 | |||
2166 | 891 | #: extra/upstart-udev-bridge.c:97 | ||
2167 | 892 | msgid "" | ||
2168 | 893 | "By default, upstart-udev-bridge does not detach from the console and remains " | ||
2169 | 894 | "in the foreground. Use the --daemon option to have it detach." | ||
2170 | 895 | msgstr "" | ||
2171 | 896 | |||
2172 | 897 | #: extra/upstart-udev-bridge.c:111 | ||
2173 | 898 | msgid "Could not connect to Upstart" | ||
2174 | 899 | msgstr "" | ||
2175 | 900 | |||
2176 | 901 | #: extra/upstart-udev-bridge.c:125 | ||
2177 | 902 | msgid "Could not create Upstart proxy" | ||
2178 | 903 | msgstr "" | ||
2179 | 904 | |||
2180 | 905 | #: extra/upstart-udev-bridge.c:149 | ||
2181 | 906 | msgid "Unable to become daemon" | ||
2182 | 907 | msgstr "" | ||
2183 | 908 | |||
2184 | 909 | #: extra/upstart-udev-bridge.c:297 | ||
2185 | 910 | msgid "Disconnected from Upstart" | ||
2186 | 911 | msgstr "" |