Merge lp:~jamesodhunt/upstart/upstream-add-session-bus-support into lp:upstart
- upstream-add-session-bus-support
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 1288 |
Proposed branch: | lp:~jamesodhunt/upstart/upstream-add-session-bus-support |
Merge into: | lp:upstart |
Diff against target: |
1773 lines (+536/-321) 21 files modified
ChangeLog (+31/-0) configure.ac (+1/-1) init/conf.c (+0/-1) init/control.c (+33/-7) init/control.h (+15/-1) init/environ.c (+0/-1) init/environ.h (+0/-1) init/job_process.c (+0/-1) init/job_process.h (+0/-1) init/main.c (+154/-133) init/man/init.8 (+6/-2) init/tests/test_conf.c (+0/-1) init/tests/test_control.c (+0/-1) init/tests/test_environ.c (+0/-1) init/tests/test_job_class.c (+0/-1) init/tests/test_job_process.c (+0/-1) po/upstart.pot (+206/-134) util/initctl.c (+56/-13) util/man/initctl.8 (+8/-2) util/reboot.c (+0/-1) util/tests/test_initctl.c (+26/-17) |
To merge this branch: | bzr merge lp:~jamesodhunt/upstart/upstream-add-session-bus-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Upstart Developers | Pending | ||
Review via email: mp+63345@code.launchpad.net |
Commit message
Description of the change
Add D-Bus session support to initctl.
* Changelog: Updated.
* util/initctl.c:
- Added "--session" command-line option.
- dbus_bus_
distinguish system/session D-Bus bus type.
- system_bus variable now replaced by two others: use_dbus (boolean)
and dbus_bus_type.
- upstart_open(): Updated to handle multiple D-Bus bus types.
* util/man/initctl.8: Update for "--session" option.
* util/tests/
dbus_bus_type rather than system_bus.
Add command-line option to use D-Bus session bus (for testing).
* init/control.c:
- Added new boolean use_session_bus.
- Updated comments.
- control_
session bus via env var "UPSTART_
Also logs use of session bus if use_session_bus set.
- control_bus_open(): Now connects to either D-Bus system bus or session bus.
* init/control.h: New define for USE_SESSION_
* init/main.c: Addition of "--session" command-line option.
* init/man/init.8: Update for new "--session" command-line option.
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2011-05-12 20:42:28 +0000 | |||
3 | +++ ChangeLog 2011-06-03 09:21:18 +0000 | |||
4 | @@ -1,3 +1,34 @@ | |||
5 | 1 | 2011-06-01 James Hunt <james.hunt@ubuntu.com> | ||
6 | 2 | |||
7 | 3 | Add D-Bus session support to initctl. | ||
8 | 4 | |||
9 | 5 | * util/initctl.c: | ||
10 | 6 | - Added "--session" command-line option. | ||
11 | 7 | - dbus_bus_type_setter(): New function used by option parser to | ||
12 | 8 | distinguish system/session D-Bus bus type. | ||
13 | 9 | - system_bus variable now replaced by two others: use_dbus (boolean) | ||
14 | 10 | and dbus_bus_type. | ||
15 | 11 | - upstart_open(): Updated to handle multiple D-Bus bus types. | ||
16 | 12 | * util/man/initctl.8: Update for "--session" option. | ||
17 | 13 | * util/tests/test_initctl.c: Updated to make use of use_dbus and | ||
18 | 14 | dbus_bus_type rather than system_bus. | ||
19 | 15 | |||
20 | 16 | 2011-05-31 James Hunt <james.hunt@ubuntu.com> | ||
21 | 17 | |||
22 | 18 | Add command-line option to use D-Bus session bus (for testing). | ||
23 | 19 | |||
24 | 20 | * init/control.c: | ||
25 | 21 | - Added new boolean use_session_bus. | ||
26 | 22 | - Updated comments. | ||
27 | 23 | - control_handle_bus_type(): New function to allow selection of | ||
28 | 24 | session bus via env var "UPSTART_USE_SESSION_BUS". | ||
29 | 25 | Also logs use of session bus if use_session_bus set. | ||
30 | 26 | - control_bus_open(): Now connects to either D-Bus system bus or session bus. | ||
31 | 27 | * init/control.h: New define for USE_SESSION_BUS_ENV. | ||
32 | 28 | * init/main.c: Addition of "--session" command-line option. | ||
33 | 29 | * init/man/init.8: Update for new "--session" command-line option. | ||
34 | 30 | * Corrected copyright notices. | ||
35 | 31 | |||
36 | 1 | 2011-05-12 Marc - A. Dahlhaus <mad@wol.de> | 32 | 2011-05-12 Marc - A. Dahlhaus <mad@wol.de> |
37 | 2 | 33 | ||
38 | 3 | * init/job_class.h (JobClass): Add kill signal member | 34 | * init/job_class.h (JobClass): Add kill signal member |
39 | 4 | 35 | ||
40 | === modified file 'configure.ac' | |||
41 | --- configure.ac 2011-03-22 17:53:17 +0000 | |||
42 | +++ configure.ac 2011-06-03 09:21:18 +0000 | |||
43 | @@ -2,7 +2,7 @@ | |||
44 | 2 | 2 | ||
45 | 3 | AC_PREREQ(2.61) | 3 | AC_PREREQ(2.61) |
46 | 4 | AC_INIT([upstart], [1.3], [upstart-devel@lists.ubuntu.com]) | 4 | AC_INIT([upstart], [1.3], [upstart-devel@lists.ubuntu.com]) |
48 | 5 | NIH_COPYRIGHT([[Copyright © 2011 Scott James Remnant, Google Inc., Canonical Ltd.]]) | 5 | NIH_COPYRIGHT([[Copyright © 2011 Scott James Remnant, Canonical Ltd.]]) |
49 | 6 | AC_CONFIG_SRCDIR([init/main.c]) | 6 | AC_CONFIG_SRCDIR([init/main.c]) |
50 | 7 | AC_CONFIG_MACRO_DIR([m4]) | 7 | AC_CONFIG_MACRO_DIR([m4]) |
51 | 8 | 8 | ||
52 | 9 | 9 | ||
53 | === modified file 'init/conf.c' | |||
54 | --- init/conf.c 2011-03-15 18:44:09 +0000 | |||
55 | +++ init/conf.c 2011-06-03 09:21:18 +0000 | |||
56 | @@ -2,7 +2,6 @@ | |||
57 | 2 | * | 2 | * |
58 | 3 | * conf.c - configuration management | 3 | * conf.c - configuration management |
59 | 4 | * | 4 | * |
60 | 5 | * Copyright © 2011 Google Inc. | ||
61 | 6 | * Copyright © 2009 Canonical Ltd. | 5 | * Copyright © 2009 Canonical Ltd. |
62 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
63 | 8 | * | 7 | * |
64 | 9 | 8 | ||
65 | === modified file 'init/control.c' | |||
66 | --- init/control.c 2009-07-11 11:47:12 +0000 | |||
67 | +++ init/control.c 2011-06-03 09:21:18 +0000 | |||
68 | @@ -2,7 +2,7 @@ | |||
69 | 2 | * | 2 | * |
70 | 3 | * control.c - D-Bus connections, objects and methods | 3 | * control.c - D-Bus connections, objects and methods |
71 | 4 | * | 4 | * |
73 | 5 | * Copyright © 2009 Canonical Ltd. | 5 | * Copyright © 2009-2011 Canonical Ltd. |
74 | 6 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
75 | 7 | * | 7 | * |
76 | 8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
77 | @@ -54,12 +54,19 @@ | |||
78 | 54 | 54 | ||
79 | 55 | #include "com.ubuntu.Upstart.h" | 55 | #include "com.ubuntu.Upstart.h" |
80 | 56 | 56 | ||
81 | 57 | |||
82 | 58 | /* Prototypes for static functions */ | 57 | /* Prototypes for static functions */ |
83 | 59 | static int control_server_connect (DBusServer *server, DBusConnection *conn); | 58 | static int control_server_connect (DBusServer *server, DBusConnection *conn); |
84 | 60 | static void control_disconnected (DBusConnection *conn); | 59 | static void control_disconnected (DBusConnection *conn); |
85 | 61 | static void control_register_all (DBusConnection *conn); | 60 | static void control_register_all (DBusConnection *conn); |
86 | 62 | 61 | ||
87 | 62 | /** | ||
88 | 63 | * use_session_bus: | ||
89 | 64 | * | ||
90 | 65 | * If TRUE, connect to the D-Bus sessio bus rather than the system bus. | ||
91 | 66 | * | ||
92 | 67 | * Used for testing. | ||
93 | 68 | **/ | ||
94 | 69 | int use_session_bus = FALSE; | ||
95 | 63 | 70 | ||
96 | 64 | /** | 71 | /** |
97 | 65 | * control_server_address: | 72 | * control_server_address: |
98 | @@ -78,7 +85,7 @@ | |||
99 | 78 | /** | 85 | /** |
100 | 79 | * control_bus: | 86 | * control_bus: |
101 | 80 | * | 87 | * |
103 | 81 | * Open connection to D-Bus system bus. The connection may be opened with | 88 | * Open connection to a D-Bus bus. The connection may be opened with |
104 | 82 | * control_bus_open() and if lost will become NULL. | 89 | * control_bus_open() and if lost will become NULL. |
105 | 83 | **/ | 90 | **/ |
106 | 84 | DBusConnection *control_bus = NULL; | 91 | DBusConnection *control_bus = NULL; |
107 | @@ -86,7 +93,7 @@ | |||
108 | 86 | /** | 93 | /** |
109 | 87 | * control_conns: | 94 | * control_conns: |
110 | 88 | * | 95 | * |
112 | 89 | * Open control connections, including the connection to the D-Bus system | 96 | * Open control connections, including the connection to a D-Bus |
113 | 90 | * bus and any private client connections. | 97 | * bus and any private client connections. |
114 | 91 | **/ | 98 | **/ |
115 | 92 | NihList *control_conns = NULL; | 99 | NihList *control_conns = NULL; |
116 | @@ -190,8 +197,9 @@ | |||
117 | 190 | /** | 197 | /** |
118 | 191 | * control_bus_open: | 198 | * control_bus_open: |
119 | 192 | * | 199 | * |
122 | 193 | * Open a connection to the D-Bus system bus and store it in the control_bus | 200 | * Open a connection to the appropriate D-Bus bus and store it in the |
123 | 194 | * global. The connection is handled automatically in the main loop. | 201 | * control_bus global. The connection is handled automatically |
124 | 202 | * in the main loop. | ||
125 | 195 | * | 203 | * |
126 | 196 | * Returns: zero on success, negative value on raised error. | 204 | * Returns: zero on success, negative value on raised error. |
127 | 197 | **/ | 205 | **/ |
128 | @@ -207,10 +215,13 @@ | |||
129 | 207 | 215 | ||
130 | 208 | control_init (); | 216 | control_init (); |
131 | 209 | 217 | ||
132 | 218 | control_handle_bus_type (); | ||
133 | 219 | |||
134 | 210 | /* Connect to the D-Bus System Bus and hook everything up into | 220 | /* Connect to the D-Bus System Bus and hook everything up into |
135 | 211 | * our own main loop automatically. | 221 | * our own main loop automatically. |
136 | 212 | */ | 222 | */ |
138 | 213 | conn = nih_dbus_bus (DBUS_BUS_SYSTEM, control_disconnected); | 223 | conn = nih_dbus_bus (use_session_bus ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, |
139 | 224 | control_disconnected); | ||
140 | 214 | if (! conn) | 225 | if (! conn) |
141 | 215 | return -1; | 226 | return -1; |
142 | 216 | 227 | ||
143 | @@ -669,3 +680,18 @@ | |||
144 | 669 | 680 | ||
145 | 670 | return 0; | 681 | return 0; |
146 | 671 | } | 682 | } |
147 | 683 | |||
148 | 684 | /** | ||
149 | 685 | * control_handle_bus_type: | ||
150 | 686 | * | ||
151 | 687 | * Determine D-Bus bus type to connect to. | ||
152 | 688 | **/ | ||
153 | 689 | void | ||
154 | 690 | control_handle_bus_type (void) | ||
155 | 691 | { | ||
156 | 692 | if (getenv (USE_SESSION_BUS_ENV)) | ||
157 | 693 | use_session_bus = TRUE; | ||
158 | 694 | |||
159 | 695 | if (use_session_bus) | ||
160 | 696 | nih_debug ("Using session bus"); | ||
161 | 697 | } | ||
162 | 672 | 698 | ||
163 | === modified file 'init/control.h' | |||
164 | --- init/control.h 2009-07-09 08:36:52 +0000 | |||
165 | +++ init/control.h 2011-06-03 09:21:18 +0000 | |||
166 | @@ -1,6 +1,6 @@ | |||
167 | 1 | /* upstart | 1 | /* upstart |
168 | 2 | * | 2 | * |
170 | 3 | * Copyright © 2009 Canonical Ltd. | 3 | * Copyright © 2009-2011 Canonical Ltd. |
171 | 4 | * Author: Scott James Remnant <scott@netsplit.com>. | 4 | * Author: Scott James Remnant <scott@netsplit.com>. |
172 | 5 | * | 5 | * |
173 | 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
174 | @@ -27,6 +27,18 @@ | |||
175 | 27 | #include <nih-dbus/dbus_connection.h> | 27 | #include <nih-dbus/dbus_connection.h> |
176 | 28 | #include <nih-dbus/dbus_message.h> | 28 | #include <nih-dbus/dbus_message.h> |
177 | 29 | 29 | ||
178 | 30 | /** | ||
179 | 31 | * USE_SESSION_BUS_ENV: | ||
180 | 32 | * | ||
181 | 33 | * If this environment variable is set to any value, connect to | ||
182 | 34 | * D-Bus session bus rather than the system bus. | ||
183 | 35 | * | ||
184 | 36 | * Used for testing. | ||
185 | 37 | **/ | ||
186 | 38 | #ifndef USE_SESSION_BUS_ENV | ||
187 | 39 | #define USE_SESSION_BUS_ENV "UPSTART_USE_SESSION_BUS" | ||
188 | 40 | #endif | ||
189 | 41 | |||
190 | 30 | 42 | ||
191 | 31 | NIH_BEGIN_EXTERN | 43 | NIH_BEGIN_EXTERN |
192 | 32 | 44 | ||
193 | @@ -72,6 +84,8 @@ | |||
194 | 72 | const char *log_priority) | 84 | const char *log_priority) |
195 | 73 | __attribute__ ((warn_unused_result)); | 85 | __attribute__ ((warn_unused_result)); |
196 | 74 | 86 | ||
197 | 87 | void control_handle_bus_type (void); | ||
198 | 88 | |||
199 | 75 | NIH_END_EXTERN | 89 | NIH_END_EXTERN |
200 | 76 | 90 | ||
201 | 77 | #endif /* INIT_CONTROL_H */ | 91 | #endif /* INIT_CONTROL_H */ |
202 | 78 | 92 | ||
203 | === modified file 'init/environ.c' | |||
204 | --- init/environ.c 2011-03-16 22:42:48 +0000 | |||
205 | +++ init/environ.c 2011-06-03 09:21:18 +0000 | |||
206 | @@ -2,7 +2,6 @@ | |||
207 | 2 | * | 2 | * |
208 | 3 | * environ.c - environment table utilities | 3 | * environ.c - environment table utilities |
209 | 4 | * | 4 | * |
210 | 5 | * Copyright © 2011 Google Inc. | ||
211 | 6 | * Copyright © 2009 Canonical Ltd. | 5 | * Copyright © 2009 Canonical Ltd. |
212 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
213 | 8 | * | 7 | * |
214 | 9 | 8 | ||
215 | === modified file 'init/environ.h' | |||
216 | --- init/environ.h 2011-03-16 22:42:48 +0000 | |||
217 | +++ init/environ.h 2011-06-03 09:21:18 +0000 | |||
218 | @@ -1,6 +1,5 @@ | |||
219 | 1 | /* upstart | 1 | /* upstart |
220 | 2 | * | 2 | * |
221 | 3 | * Copyright © 2011 Google Inc. | ||
222 | 4 | * Copyright © 2009 Canonical Ltd. | 3 | * Copyright © 2009 Canonical Ltd. |
223 | 5 | * Author: Scott James Remnant <scott@netsplit.com>. | 4 | * Author: Scott James Remnant <scott@netsplit.com>. |
224 | 6 | * | 5 | * |
225 | 7 | 6 | ||
226 | === modified file 'init/job_process.c' | |||
227 | --- init/job_process.c 2011-05-12 20:42:28 +0000 | |||
228 | +++ init/job_process.c 2011-06-03 09:21:18 +0000 | |||
229 | @@ -2,7 +2,6 @@ | |||
230 | 2 | * | 2 | * |
231 | 3 | * job_process.c - job process handling | 3 | * job_process.c - job process handling |
232 | 4 | * | 4 | * |
233 | 5 | * Copyright © 2011 Google Inc. | ||
234 | 6 | * Copyright © 2011 Canonical Ltd. | 5 | * Copyright © 2011 Canonical Ltd. |
235 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
236 | 8 | * | 7 | * |
237 | 9 | 8 | ||
238 | === modified file 'init/job_process.h' | |||
239 | --- init/job_process.h 2011-05-12 19:21:16 +0000 | |||
240 | +++ init/job_process.h 2011-06-03 09:21:18 +0000 | |||
241 | @@ -1,6 +1,5 @@ | |||
242 | 1 | /* upstart | 1 | /* upstart |
243 | 2 | * | 2 | * |
244 | 3 | * Copyright © 2011 Google Inc. | ||
245 | 4 | * Copyright © 2009 Canonical Ltd. | 3 | * Copyright © 2009 Canonical Ltd. |
246 | 5 | * Author: Scott James Remnant <scott@netsplit.com>. | 4 | * Author: Scott James Remnant <scott@netsplit.com>. |
247 | 6 | * | 5 | * |
248 | 7 | 6 | ||
249 | === modified file 'init/main.c' | |||
250 | --- init/main.c 2011-03-16 22:54:56 +0000 | |||
251 | +++ init/main.c 2011-06-03 09:21:18 +0000 | |||
252 | @@ -1,7 +1,6 @@ | |||
253 | 1 | /* upstart | 1 | /* upstart |
254 | 2 | * | 2 | * |
257 | 3 | * Copyright © 2011 Google Inc. | 3 | * Copyright © 2009-2011 Canonical Ltd. |
256 | 4 | * Copyright © 2010 Canonical Ltd. | ||
258 | 5 | * Author: Scott James Remnant <scott@netsplit.com>. | 4 | * Author: Scott James Remnant <scott@netsplit.com>. |
259 | 6 | * | 5 | * |
260 | 7 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
261 | @@ -88,6 +87,7 @@ | |||
262 | 88 | **/ | 87 | **/ |
263 | 89 | static int restart = FALSE; | 88 | static int restart = FALSE; |
264 | 90 | 89 | ||
265 | 90 | extern int use_session_bus; | ||
266 | 91 | 91 | ||
267 | 92 | /** | 92 | /** |
268 | 93 | * options: | 93 | * options: |
269 | @@ -97,6 +97,9 @@ | |||
270 | 97 | static NihOption options[] = { | 97 | static NihOption options[] = { |
271 | 98 | { 0, "restart", NULL, NULL, NULL, &restart, NULL }, | 98 | { 0, "restart", NULL, NULL, NULL, &restart, NULL }, |
272 | 99 | 99 | ||
273 | 100 | { 0, "session", N_("use D-Bus session bus rather than system bus (for testing)"), | ||
274 | 101 | NULL, NULL, &use_session_bus, NULL }, | ||
275 | 102 | |||
276 | 100 | /* Ignore invalid options */ | 103 | /* Ignore invalid options */ |
277 | 101 | { '-', "--", NULL, NULL, NULL, NULL, NULL }, | 104 | { '-', "--", NULL, NULL, NULL, NULL, NULL }, |
278 | 102 | 105 | ||
279 | @@ -124,94 +127,104 @@ | |||
280 | 124 | if (! args) | 127 | if (! args) |
281 | 125 | exit (1); | 128 | exit (1); |
282 | 126 | 129 | ||
283 | 130 | control_handle_bus_type (); | ||
284 | 131 | |||
285 | 127 | #ifndef DEBUG | 132 | #ifndef DEBUG |
369 | 128 | /* Check we're root */ | 133 | if (use_session_bus == FALSE) { |
370 | 129 | if (getuid ()) { | 134 | |
371 | 130 | nih_fatal (_("Need to be root")); | 135 | /* Check we're root */ |
372 | 131 | exit (1); | 136 | if (getuid ()) { |
373 | 132 | } | 137 | nih_fatal (_("Need to be root")); |
374 | 133 | 138 | exit (1); | |
375 | 134 | /* Check we're process #1 */ | 139 | } |
376 | 135 | if (getpid () > 1) { | 140 | |
377 | 136 | execv (TELINIT, argv); | 141 | /* Check we're process #1 */ |
378 | 137 | /* Ignore failure, probably just that telinit doesn't exist */ | 142 | if (getpid () > 1) { |
379 | 138 | 143 | execv (TELINIT, argv); | |
380 | 139 | nih_fatal (_("Not being executed as init")); | 144 | /* Ignore failure, probably just that telinit doesn't exist */ |
381 | 140 | exit (1); | 145 | |
382 | 141 | } | 146 | nih_fatal (_("Not being executed as init")); |
383 | 142 | 147 | exit (1); | |
384 | 143 | /* Clear our arguments from the command-line, so that we show up in | 148 | } |
385 | 144 | * ps or top output as /sbin/init, with no extra flags. | 149 | |
386 | 145 | * | 150 | /* Clear our arguments from the command-line, so that we show up in |
387 | 146 | * This is a very Linux-specific trick; by deleting the NULL | 151 | * ps or top output as /sbin/init, with no extra flags. |
388 | 147 | * terminator at the end of the last argument, we fool the kernel | 152 | * |
389 | 148 | * into believing we used a setproctitle()-a-like to extend the | 153 | * This is a very Linux-specific trick; by deleting the NULL |
390 | 149 | * argument space into the environment space, and thus make it use | 154 | * terminator at the end of the last argument, we fool the kernel |
391 | 150 | * strlen() instead of its own assumed length. In fact, we've done | 155 | * into believing we used a setproctitle()-a-like to extend the |
392 | 151 | * the exact opposite, and shrunk the command line length to just that | 156 | * argument space into the environment space, and thus make it use |
393 | 152 | * of whatever is in argv[0]. | 157 | * strlen() instead of its own assumed length. In fact, we've done |
394 | 153 | * | 158 | * the exact opposite, and shrunk the command line length to just that |
395 | 154 | * If we don't do this, and just write \0 over the rest of argv, for | 159 | * of whatever is in argv[0]. |
396 | 155 | * example; the command-line length still includes those \0s, and ps | 160 | * |
397 | 156 | * will show whitespace in their place. | 161 | * If we don't do this, and just write \0 over the rest of argv, for |
398 | 157 | */ | 162 | * example; the command-line length still includes those \0s, and ps |
399 | 158 | if (argc > 1) { | 163 | * will show whitespace in their place. |
400 | 159 | char *arg_end; | 164 | */ |
401 | 160 | 165 | if (argc > 1) { | |
402 | 161 | arg_end = argv[argc-1] + strlen (argv[argc-1]); | 166 | char *arg_end; |
403 | 162 | *arg_end = ' '; | 167 | |
404 | 163 | } | 168 | arg_end = argv[argc-1] + strlen (argv[argc-1]); |
405 | 164 | 169 | *arg_end = ' '; | |
406 | 165 | 170 | } | |
407 | 166 | /* Become the leader of a new session and process group, shedding | 171 | |
408 | 167 | * any controlling tty (which we shouldn't have had anyway - but | 172 | |
409 | 168 | * you never know what initramfs did). | 173 | /* Become the leader of a new session and process group, shedding |
410 | 169 | */ | 174 | * any controlling tty (which we shouldn't have had anyway - but |
411 | 170 | setsid (); | 175 | * you never know what initramfs did). |
412 | 171 | 176 | */ | |
413 | 172 | /* Set the standard file descriptors to the ordinary console device, | 177 | setsid (); |
414 | 173 | * resetting it to sane defaults unless we're inheriting from another | 178 | |
415 | 174 | * init process which we know left it in a sane state. | 179 | /* Set the standard file descriptors to the ordinary console device, |
416 | 175 | */ | 180 | * resetting it to sane defaults unless we're inheriting from another |
417 | 176 | if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0) | 181 | * init process which we know left it in a sane state. |
418 | 177 | nih_free (nih_error_get ()); | 182 | */ |
419 | 178 | 183 | if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0) | |
420 | 179 | /* Set the PATH environment variable */ | 184 | nih_free (nih_error_get ()); |
421 | 180 | setenv ("PATH", PATH, TRUE); | 185 | |
422 | 181 | 186 | /* Set the PATH environment variable */ | |
423 | 182 | /* Switch to the root directory in case we were started from some | 187 | setenv ("PATH", PATH, TRUE); |
424 | 183 | * strange place, or worse, some directory in the initramfs that's | 188 | |
425 | 184 | * going to go away soon. | 189 | /* Switch to the root directory in case we were started from some |
426 | 185 | */ | 190 | * strange place, or worse, some directory in the initramfs that's |
427 | 186 | if (chdir ("/")) | 191 | * going to go away soon. |
428 | 187 | nih_warn ("%s: %s", _("Unable to set root directory"), | 192 | */ |
429 | 188 | strerror (errno)); | 193 | if (chdir ("/")) |
430 | 189 | 194 | nih_warn ("%s: %s", _("Unable to set root directory"), | |
431 | 190 | /* Mount the /proc and /sys filesystems, which are pretty much | 195 | strerror (errno)); |
432 | 191 | * essential for any Linux system; not to mention used by | 196 | |
433 | 192 | * ourselves. | 197 | /* Mount the /proc and /sys filesystems, which are pretty much |
434 | 193 | */ | 198 | * essential for any Linux system; not to mention used by |
435 | 194 | if (system_mount ("proc", "/proc") < 0) { | 199 | * ourselves. |
436 | 195 | NihError *err; | 200 | */ |
437 | 196 | 201 | if (system_mount ("proc", "/proc") < 0) { | |
438 | 197 | err = nih_error_get (); | 202 | NihError *err; |
439 | 198 | nih_warn ("%s: %s", _("Unable to mount /proc filesystem"), | 203 | |
440 | 199 | err->message); | 204 | err = nih_error_get (); |
441 | 200 | nih_free (err); | 205 | nih_warn ("%s: %s", _("Unable to mount /proc filesystem"), |
442 | 201 | } | 206 | err->message); |
443 | 202 | 207 | nih_free (err); | |
444 | 203 | if (system_mount ("sysfs", "/sys") < 0) { | 208 | } |
445 | 204 | NihError *err; | 209 | |
446 | 205 | 210 | if (system_mount ("sysfs", "/sys") < 0) { | |
447 | 206 | err = nih_error_get (); | 211 | NihError *err; |
448 | 207 | nih_warn ("%s: %s", _("Unable to mount /sys filesystem"), | 212 | |
449 | 208 | err->message); | 213 | err = nih_error_get (); |
450 | 209 | nih_free (err); | 214 | nih_warn ("%s: %s", _("Unable to mount /sys filesystem"), |
451 | 210 | } | 215 | err->message); |
452 | 216 | nih_free (err); | ||
453 | 217 | } | ||
454 | 218 | } else { | ||
455 | 219 | nih_log_set_priority (NIH_LOG_DEBUG); | ||
456 | 220 | nih_debug ("Running with UID %d as PID %d (PPID %d)", | ||
457 | 221 | (int)getuid (), (int)getpid (), (int)getppid ()); | ||
458 | 222 | } | ||
459 | 223 | |||
460 | 211 | #else /* DEBUG */ | 224 | #else /* DEBUG */ |
461 | 212 | nih_log_set_priority (NIH_LOG_DEBUG); | 225 | nih_log_set_priority (NIH_LOG_DEBUG); |
464 | 213 | nih_debug ("Running as PID %d (PPID %d)", | 226 | nih_debug ("Running with UID %d as PID %d (PPID %d)", |
465 | 214 | (int)getpid (), (int)getppid ()); | 227 | (int)getuid (), (int)getpid (), (int)getppid ()); |
466 | 215 | #endif /* DEBUG */ | 228 | #endif /* DEBUG */ |
467 | 216 | 229 | ||
468 | 217 | 230 | ||
469 | @@ -223,11 +236,13 @@ | |||
470 | 223 | nih_signal_reset (); | 236 | nih_signal_reset (); |
471 | 224 | 237 | ||
472 | 225 | #ifndef DEBUG | 238 | #ifndef DEBUG |
478 | 226 | /* Catch fatal errors immediately rather than waiting for a new | 239 | if (use_session_bus == FALSE) { |
479 | 227 | * iteration through the main loop. | 240 | /* Catch fatal errors immediately rather than waiting for a new |
480 | 228 | */ | 241 | * iteration through the main loop. |
481 | 229 | nih_signal_set_handler (SIGSEGV, crash_handler); | 242 | */ |
482 | 230 | nih_signal_set_handler (SIGABRT, crash_handler); | 243 | nih_signal_set_handler (SIGSEGV, crash_handler); |
483 | 244 | nih_signal_set_handler (SIGABRT, crash_handler); | ||
484 | 245 | } | ||
485 | 231 | #endif /* DEBUG */ | 246 | #endif /* DEBUG */ |
486 | 232 | 247 | ||
487 | 233 | /* Don't ignore SIGCHLD or SIGALRM, but don't respond to them | 248 | /* Don't ignore SIGCHLD or SIGALRM, but don't respond to them |
488 | @@ -238,33 +253,35 @@ | |||
489 | 238 | nih_signal_set_handler (SIGALRM, nih_signal_handler); | 253 | nih_signal_set_handler (SIGALRM, nih_signal_handler); |
490 | 239 | 254 | ||
491 | 240 | #ifndef DEBUG | 255 | #ifndef DEBUG |
506 | 241 | /* Ask the kernel to send us SIGINT when control-alt-delete is | 256 | if (use_session_bus == FALSE) { |
507 | 242 | * pressed; generate an event with the same name. | 257 | /* Ask the kernel to send us SIGINT when control-alt-delete is |
508 | 243 | */ | 258 | * pressed; generate an event with the same name. |
509 | 244 | reboot (RB_DISABLE_CAD); | 259 | */ |
510 | 245 | nih_signal_set_handler (SIGINT, nih_signal_handler); | 260 | reboot (RB_DISABLE_CAD); |
511 | 246 | NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cad_handler, NULL)); | 261 | nih_signal_set_handler (SIGINT, nih_signal_handler); |
512 | 247 | 262 | NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cad_handler, NULL)); | |
513 | 248 | /* Ask the kernel to send us SIGWINCH when alt-uparrow is pressed; | 263 | |
514 | 249 | * generate a keyboard-request event. | 264 | /* Ask the kernel to send us SIGWINCH when alt-uparrow is pressed; |
515 | 250 | */ | 265 | * generate a keyboard-request event. |
516 | 251 | if (ioctl (0, KDSIGACCEPT, SIGWINCH) == 0) { | 266 | */ |
517 | 252 | nih_signal_set_handler (SIGWINCH, nih_signal_handler); | 267 | if (ioctl (0, KDSIGACCEPT, SIGWINCH) == 0) { |
518 | 253 | NIH_MUST (nih_signal_add_handler (NULL, SIGWINCH, | 268 | nih_signal_set_handler (SIGWINCH, nih_signal_handler); |
519 | 254 | kbd_handler, NULL)); | 269 | NIH_MUST (nih_signal_add_handler (NULL, SIGWINCH, |
520 | 270 | kbd_handler, NULL)); | ||
521 | 271 | } | ||
522 | 272 | |||
523 | 273 | /* powstatd sends us SIGPWR when it changes /etc/powerstatus */ | ||
524 | 274 | nih_signal_set_handler (SIGPWR, nih_signal_handler); | ||
525 | 275 | NIH_MUST (nih_signal_add_handler (NULL, SIGPWR, pwr_handler, NULL)); | ||
526 | 276 | |||
527 | 277 | /* SIGHUP instructs us to re-load our configuration */ | ||
528 | 278 | nih_signal_set_handler (SIGHUP, nih_signal_handler); | ||
529 | 279 | NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); | ||
530 | 280 | |||
531 | 281 | /* SIGUSR1 instructs us to reconnect to D-Bus */ | ||
532 | 282 | nih_signal_set_handler (SIGUSR1, nih_signal_handler); | ||
533 | 283 | NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); | ||
534 | 255 | } | 284 | } |
535 | 256 | |||
536 | 257 | /* powstatd sends us SIGPWR when it changes /etc/powerstatus */ | ||
537 | 258 | nih_signal_set_handler (SIGPWR, nih_signal_handler); | ||
538 | 259 | NIH_MUST (nih_signal_add_handler (NULL, SIGPWR, pwr_handler, NULL)); | ||
539 | 260 | |||
540 | 261 | /* SIGHUP instructs us to re-load our configuration */ | ||
541 | 262 | nih_signal_set_handler (SIGHUP, nih_signal_handler); | ||
542 | 263 | NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); | ||
543 | 264 | |||
544 | 265 | /* SIGUSR1 instructs us to reconnect to D-Bus */ | ||
545 | 266 | nih_signal_set_handler (SIGUSR1, nih_signal_handler); | ||
546 | 267 | NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); | ||
547 | 268 | #endif /* DEBUG */ | 285 | #endif /* DEBUG */ |
548 | 269 | 286 | ||
549 | 270 | 287 | ||
550 | @@ -284,20 +301,22 @@ | |||
551 | 284 | conf_reload (); | 301 | conf_reload (); |
552 | 285 | 302 | ||
553 | 286 | /* Create a listening server for private connections. */ | 303 | /* Create a listening server for private connections. */ |
556 | 287 | while (control_server_open () < 0) { | 304 | if (use_session_bus == FALSE) { |
557 | 288 | NihError *err; | 305 | while (control_server_open () < 0) { |
558 | 306 | NihError *err; | ||
559 | 289 | 307 | ||
564 | 290 | err = nih_error_get (); | 308 | err = nih_error_get (); |
565 | 291 | if (err->number != ENOMEM) { | 309 | if (err->number != ENOMEM) { |
566 | 292 | nih_warn ("%s: %s", _("Unable to listen for private connections"), | 310 | nih_warn ("%s: %s", _("Unable to listen for private connections"), |
567 | 293 | err->message); | 311 | err->message); |
568 | 312 | nih_free (err); | ||
569 | 313 | break; | ||
570 | 314 | } | ||
571 | 294 | nih_free (err); | 315 | nih_free (err); |
572 | 295 | break; | ||
573 | 296 | } | 316 | } |
574 | 297 | nih_free (err); | ||
575 | 298 | } | 317 | } |
576 | 299 | 318 | ||
578 | 300 | /* Open connection to the system bus; we normally expect this to | 319 | /* Open connection to the appropriate D-Bus bus; we normally expect this to |
579 | 301 | * fail and will try again later - don't let ENOMEM stop us though. | 320 | * fail and will try again later - don't let ENOMEM stop us though. |
580 | 302 | */ | 321 | */ |
581 | 303 | while (control_bus_open () < 0) { | 322 | while (control_bus_open () < 0) { |
582 | @@ -313,13 +332,15 @@ | |||
583 | 313 | } | 332 | } |
584 | 314 | 333 | ||
585 | 315 | #ifndef DEBUG | 334 | #ifndef DEBUG |
591 | 316 | /* Now that the startup is complete, send all further logging output | 335 | if (use_session_bus == FALSE) { |
592 | 317 | * to kmsg instead of to the console. | 336 | /* Now that the startup is complete, send all further logging output |
593 | 318 | */ | 337 | * to kmsg instead of to the console. |
594 | 319 | if (system_setup_console (CONSOLE_NONE, FALSE) < 0) | 338 | */ |
595 | 320 | nih_free (nih_error_get ()); | 339 | if (system_setup_console (CONSOLE_NONE, FALSE) < 0) |
596 | 340 | nih_free (nih_error_get ()); | ||
597 | 321 | 341 | ||
599 | 322 | nih_log_set_logger (logger_kmsg); | 342 | nih_log_set_logger (logger_kmsg); |
600 | 343 | } | ||
601 | 323 | #endif /* DEBUG */ | 344 | #endif /* DEBUG */ |
602 | 324 | 345 | ||
603 | 325 | 346 | ||
604 | 326 | 347 | ||
605 | === modified file 'init/man/init.8' | |||
606 | --- init/man/init.8 2010-02-04 19:26:17 +0000 | |||
607 | +++ init/man/init.8 2011-06-03 09:21:18 +0000 | |||
608 | @@ -1,4 +1,4 @@ | |||
610 | 1 | .TH init 8 2010-02-04 "Upstart" | 1 | .TH init 8 2011-05-31 "Upstart" |
611 | 2 | .\" | 2 | .\" |
612 | 3 | .SH NAME | 3 | .SH NAME |
613 | 4 | init \- Upstart process management daemon | 4 | init \- Upstart process management daemon |
614 | @@ -64,6 +64,10 @@ | |||
615 | 64 | by placing them on the kernel command-line. | 64 | by placing them on the kernel command-line. |
616 | 65 | .\" | 65 | .\" |
617 | 66 | .TP | 66 | .TP |
618 | 67 | .B \-\-session | ||
619 | 68 | Connect to the D\-Bus session bus. This should only be used for testing. | ||
620 | 69 | .\" | ||
621 | 70 | .TP | ||
622 | 67 | .B --verbose | 71 | .B --verbose |
623 | 68 | Outputs verbose messages about job state changes and event emissions to the | 72 | Outputs verbose messages about job state changes and event emissions to the |
624 | 69 | system console or log, useful for debugging boot. | 73 | system console or log, useful for debugging boot. |
625 | @@ -90,7 +94,7 @@ | |||
626 | 90 | .RB < https://launchpad.net/upstart/+bugs > | 94 | .RB < https://launchpad.net/upstart/+bugs > |
627 | 91 | .\" | 95 | .\" |
628 | 92 | .SH COPYRIGHT | 96 | .SH COPYRIGHT |
630 | 93 | Copyright \(co 2010 Canonical Ltd. | 97 | Copyright \(co 2009-2011 Canonical Ltd. |
631 | 94 | .br | 98 | .br |
632 | 95 | This is free software; see the source for copying conditions. There is NO | 99 | This is free software; see the source for copying conditions. There is NO |
633 | 96 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 100 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
634 | 97 | 101 | ||
635 | === modified file 'init/tests/test_conf.c' | |||
636 | --- init/tests/test_conf.c 2011-02-17 23:38:17 +0000 | |||
637 | +++ init/tests/test_conf.c 2011-06-03 09:21:18 +0000 | |||
638 | @@ -2,7 +2,6 @@ | |||
639 | 2 | * | 2 | * |
640 | 3 | * test_conf.c - test suite for init/conf.c | 3 | * test_conf.c - test suite for init/conf.c |
641 | 4 | * | 4 | * |
642 | 5 | * Copyright © 2011 Google Inc. | ||
643 | 6 | * Copyright © 2009 Canonical Ltd. | 5 | * Copyright © 2009 Canonical Ltd. |
644 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
645 | 8 | * | 7 | * |
646 | 9 | 8 | ||
647 | === modified file 'init/tests/test_control.c' | |||
648 | --- init/tests/test_control.c 2011-03-16 22:42:48 +0000 | |||
649 | +++ init/tests/test_control.c 2011-06-03 09:21:18 +0000 | |||
650 | @@ -2,7 +2,6 @@ | |||
651 | 2 | * | 2 | * |
652 | 3 | * test_dbus.c - test suite for init/dbus.c | 3 | * test_dbus.c - test suite for init/dbus.c |
653 | 4 | * | 4 | * |
654 | 5 | * Copyright © 2011 Google Inc. | ||
655 | 6 | * Copyright © 2010 Canonical Ltd. | 5 | * Copyright © 2010 Canonical Ltd. |
656 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
657 | 8 | * | 7 | * |
658 | 9 | 8 | ||
659 | === modified file 'init/tests/test_environ.c' | |||
660 | --- init/tests/test_environ.c 2011-03-16 22:42:48 +0000 | |||
661 | +++ init/tests/test_environ.c 2011-06-03 09:21:18 +0000 | |||
662 | @@ -2,7 +2,6 @@ | |||
663 | 2 | * | 2 | * |
664 | 3 | * test_environ.c - test suite for init/environ.c | 3 | * test_environ.c - test suite for init/environ.c |
665 | 4 | * | 4 | * |
666 | 5 | * Copyright © 2011 Google Inc. | ||
667 | 6 | * Copyright © 2009 Canonical Ltd. | 5 | * Copyright © 2009 Canonical Ltd. |
668 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
669 | 8 | * | 7 | * |
670 | 9 | 8 | ||
671 | === modified file 'init/tests/test_job_class.c' | |||
672 | --- init/tests/test_job_class.c 2011-05-12 20:42:28 +0000 | |||
673 | +++ init/tests/test_job_class.c 2011-06-03 09:21:18 +0000 | |||
674 | @@ -2,7 +2,6 @@ | |||
675 | 2 | * | 2 | * |
676 | 3 | * test_job_class.c - test suite for init/job_class.c | 3 | * test_job_class.c - test suite for init/job_class.c |
677 | 4 | * | 4 | * |
678 | 5 | * Copyright © 2011 Google Inc. | ||
679 | 6 | * Copyright © 2010 Canonical Ltd. | 5 | * Copyright © 2010 Canonical Ltd. |
680 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
681 | 8 | * | 7 | * |
682 | 9 | 8 | ||
683 | === modified file 'init/tests/test_job_process.c' | |||
684 | --- init/tests/test_job_process.c 2011-05-12 19:21:16 +0000 | |||
685 | +++ init/tests/test_job_process.c 2011-06-03 09:21:18 +0000 | |||
686 | @@ -2,7 +2,6 @@ | |||
687 | 2 | * | 2 | * |
688 | 3 | * test_job_process.c - test suite for init/job_process.c | 3 | * test_job_process.c - test suite for init/job_process.c |
689 | 4 | * | 4 | * |
690 | 5 | * Copyright © 2011 Google Inc. | ||
691 | 6 | * Copyright © 2011 Canonical Ltd. | 5 | * Copyright © 2011 Canonical Ltd. |
692 | 7 | * Author: Scott James Remnant <scott@netsplit.com>. | 6 | * Author: Scott James Remnant <scott@netsplit.com>. |
693 | 8 | * | 7 | * |
694 | 9 | 8 | ||
695 | === modified file 'po/upstart.pot' | |||
696 | --- po/upstart.pot 2011-03-22 17:52:25 +0000 | |||
697 | +++ po/upstart.pot 2011-06-03 09:21:18 +0000 | |||
698 | @@ -6,76 +6,141 @@ | |||
699 | 6 | #, fuzzy | 6 | #, fuzzy |
700 | 7 | msgid "" | 7 | msgid "" |
701 | 8 | msgstr "" | 8 | msgstr "" |
703 | 9 | "Project-Id-Version: upstart 1.2\n" | 9 | "Project-Id-Version: upstart 1.3\n" |
704 | 10 | "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" | 10 | "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" |
706 | 11 | "POT-Creation-Date: 2011-03-22 10:52-0700\n" | 11 | "POT-Creation-Date: 2011-05-31 17:52+0100\n" |
707 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
708 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
709 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
710 | 15 | "Language: \n" | ||
711 | 15 | "MIME-Version: 1.0\n" | 16 | "MIME-Version: 1.0\n" |
712 | 16 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
713 | 17 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
714 | 18 | 19 | ||
716 | 19 | #: init/conf.c:238 | 20 | #: init/conf.c:237 |
717 | 20 | msgid "Unable to load configuration" | 21 | msgid "Unable to load configuration" |
718 | 21 | msgstr "" | 22 | msgstr "" |
719 | 22 | 23 | ||
721 | 23 | #: init/conf.c:271 | 24 | #: init/conf.c:270 |
722 | 24 | #, c-format | 25 | #, c-format |
723 | 25 | msgid "Loading configuration from %s" | 26 | msgid "Loading configuration from %s" |
724 | 26 | msgstr "" | 27 | msgstr "" |
725 | 27 | 28 | ||
727 | 28 | #: init/conf.c:308 | 29 | #: init/conf.c:307 |
728 | 29 | #, c-format | 30 | #, c-format |
729 | 30 | msgid "Handling deletion of %s" | 31 | msgid "Handling deletion of %s" |
730 | 31 | msgstr "" | 32 | msgstr "" |
731 | 32 | 33 | ||
733 | 33 | #: init/conf.c:379 | 34 | #: init/conf.c:378 |
734 | 34 | msgid "Unable to watch configuration file" | 35 | msgid "Unable to watch configuration file" |
735 | 35 | msgstr "" | 36 | msgstr "" |
736 | 36 | 37 | ||
738 | 37 | #: init/conf.c:457 | 38 | #: init/conf.c:456 |
739 | 38 | msgid "Unable to watch configuration directory" | 39 | msgid "Unable to watch configuration directory" |
740 | 39 | msgstr "" | 40 | msgstr "" |
741 | 40 | 41 | ||
743 | 41 | #: init/conf.c:569 init/conf.c:653 | 42 | #: init/conf.c:568 init/conf.c:652 |
744 | 42 | msgid "Error while loading configuration file" | 43 | msgid "Error while loading configuration file" |
745 | 43 | msgstr "" | 44 | msgstr "" |
746 | 44 | 45 | ||
748 | 45 | #: init/conf.c:609 | 46 | #: init/conf.c:608 |
749 | 46 | msgid "Configuration directory deleted" | 47 | msgid "Configuration directory deleted" |
750 | 47 | msgstr "" | 48 | msgstr "" |
751 | 48 | 49 | ||
753 | 49 | #: init/control.c:155 | 50 | #: init/control.c:162 |
754 | 50 | msgid "Connection from private client" | 51 | msgid "Connection from private client" |
755 | 51 | msgstr "" | 52 | msgstr "" |
756 | 52 | 53 | ||
758 | 53 | #: init/control.c:290 | 54 | #: init/control.c:301 |
759 | 54 | msgid "Disconnected from system bus" | 55 | msgid "Disconnected from system bus" |
760 | 55 | msgstr "" | 56 | msgstr "" |
761 | 56 | 57 | ||
763 | 57 | #: init/control.c:356 init/main.c:546 | 58 | #: init/control.c:367 init/main.c:567 |
764 | 58 | msgid "Reloading configuration" | 59 | msgid "Reloading configuration" |
765 | 59 | msgstr "" | 60 | msgstr "" |
766 | 60 | 61 | ||
768 | 61 | #: init/control.c:396 init/control.c:507 | 62 | #: init/control.c:407 init/control.c:518 |
769 | 62 | msgid "Name may not be empty string" | 63 | msgid "Name may not be empty string" |
770 | 63 | msgstr "" | 64 | msgstr "" |
771 | 64 | 65 | ||
773 | 65 | #: init/control.c:405 | 66 | #: init/control.c:416 |
774 | 66 | #, c-format | 67 | #, c-format |
775 | 67 | msgid "Unknown job: %s" | 68 | msgid "Unknown job: %s" |
776 | 68 | msgstr "" | 69 | msgstr "" |
777 | 69 | 70 | ||
780 | 70 | #: init/control.c:514 init/job_class.c:522 init/job_class.c:710 | 71 | #: init/control.c:525 init/job_class.c:524 init/job_class.c:712 |
781 | 71 | #: init/job_class.c:829 init/job_class.c:953 | 72 | #: init/job_class.c:831 init/job_class.c:955 |
782 | 72 | msgid "Env must be KEY=VALUE pairs" | 73 | msgid "Env must be KEY=VALUE pairs" |
783 | 73 | msgstr "" | 74 | msgstr "" |
784 | 74 | 75 | ||
786 | 75 | #: init/control.c:666 | 76 | #: init/control.c:677 |
787 | 76 | msgid "The log priority given was not recognised" | 77 | msgid "The log priority given was not recognised" |
788 | 77 | msgstr "" | 78 | msgstr "" |
789 | 78 | 79 | ||
790 | 80 | #: init/errors.h:58 | ||
791 | 81 | msgid "Illegal parameter" | ||
792 | 82 | msgstr "" | ||
793 | 83 | |||
794 | 84 | #: init/errors.h:59 | ||
795 | 85 | msgid "Unknown parameter" | ||
796 | 86 | msgstr "" | ||
797 | 87 | |||
798 | 88 | #: init/errors.h:60 init/errors.h:71 | ||
799 | 89 | msgid "Expected operator" | ||
800 | 90 | msgstr "" | ||
801 | 91 | |||
802 | 92 | #: init/errors.h:61 | ||
803 | 93 | msgid "Mismatched braces" | ||
804 | 94 | msgstr "" | ||
805 | 95 | |||
806 | 96 | #: init/errors.h:62 | ||
807 | 97 | msgid "Illegal interval, expected number of seconds" | ||
808 | 98 | msgstr "" | ||
809 | 99 | |||
810 | 100 | #: init/errors.h:63 | ||
811 | 101 | msgid "Illegal exit status, expected integer" | ||
812 | 102 | msgstr "" | ||
813 | 103 | |||
814 | 104 | #: init/errors.h:64 | ||
815 | 105 | msgid "Illegal signal status, expected integer" | ||
816 | 106 | msgstr "" | ||
817 | 107 | |||
818 | 108 | #: init/errors.h:65 | ||
819 | 109 | msgid "Illegal file creation mask, expected octal integer" | ||
820 | 110 | msgstr "" | ||
821 | 111 | |||
822 | 112 | #: init/errors.h:66 | ||
823 | 113 | msgid "Illegal nice value, expected -20 to 19" | ||
824 | 114 | msgstr "" | ||
825 | 115 | |||
826 | 116 | #: init/errors.h:67 | ||
827 | 117 | msgid "Illegal oom adjustment, expected -16 to 15 or 'never'" | ||
828 | 118 | msgstr "" | ||
829 | 119 | |||
830 | 120 | #: init/errors.h:68 | ||
831 | 121 | msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'" | ||
832 | 122 | msgstr "" | ||
833 | 123 | |||
834 | 124 | #: init/errors.h:69 | ||
835 | 125 | msgid "Illegal limit, expected 'unlimited' or integer" | ||
836 | 126 | msgstr "" | ||
837 | 127 | |||
838 | 128 | #: init/errors.h:70 | ||
839 | 129 | msgid "Expected event" | ||
840 | 130 | msgstr "" | ||
841 | 131 | |||
842 | 132 | #: init/errors.h:72 | ||
843 | 133 | msgid "Expected variable name before value" | ||
844 | 134 | msgstr "" | ||
845 | 135 | |||
846 | 136 | #: init/errors.h:73 | ||
847 | 137 | msgid "Mismatched parentheses" | ||
848 | 138 | msgstr "" | ||
849 | 139 | |||
850 | 140 | #: init/errors.h:74 | ||
851 | 141 | msgid "Name already taken" | ||
852 | 142 | msgstr "" | ||
853 | 143 | |||
854 | 79 | #: init/event.c:273 | 144 | #: init/event.c:273 |
855 | 80 | #, c-format | 145 | #, c-format |
856 | 81 | msgid "Handling %s event" | 146 | msgid "Handling %s event" |
857 | @@ -164,241 +229,240 @@ | |||
858 | 164 | msgid "post-stop" | 229 | msgid "post-stop" |
859 | 165 | msgstr "" | 230 | msgstr "" |
860 | 166 | 231 | ||
862 | 167 | #: init/job.c:1113 init/job_class.c:756 | 232 | #: init/job.c:1113 init/job_class.c:758 |
863 | 168 | #, c-format | 233 | #, c-format |
864 | 169 | msgid "Job is already running: %s" | 234 | msgid "Job is already running: %s" |
865 | 170 | msgstr "" | 235 | msgstr "" |
866 | 171 | 236 | ||
868 | 172 | #: init/job.c:1177 init/job.c:1242 init/job_class.c:875 init/job_class.c:998 | 237 | #: init/job.c:1177 init/job.c:1242 init/job_class.c:877 init/job_class.c:1000 |
869 | 173 | #, c-format | 238 | #, c-format |
870 | 174 | msgid "Job has already been stopped: %s" | 239 | msgid "Job has already been stopped: %s" |
871 | 175 | msgstr "" | 240 | msgstr "" |
872 | 176 | 241 | ||
875 | 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 |
876 | 178 | #: init/job_class.c:990 | 243 | #: init/job_class.c:992 |
877 | 179 | #, c-format | 244 | #, c-format |
878 | 180 | msgid "Unknown instance: %s" | 245 | msgid "Unknown instance: %s" |
879 | 181 | msgstr "" | 246 | msgstr "" |
880 | 182 | 247 | ||
882 | 183 | #: init/job_process.c:279 | 248 | #: init/job_process.c:276 |
883 | 184 | #, c-format | 249 | #, c-format |
884 | 185 | msgid "Failed to spawn %s %s process: %s" | 250 | msgid "Failed to spawn %s %s process: %s" |
885 | 186 | msgstr "" | 251 | msgstr "" |
886 | 187 | 252 | ||
888 | 188 | #: init/job_process.c:285 | 253 | #: init/job_process.c:282 |
889 | 189 | msgid "Temporary process spawn error" | 254 | msgid "Temporary process spawn error" |
890 | 190 | msgstr "" | 255 | msgstr "" |
891 | 191 | 256 | ||
893 | 192 | #: init/job_process.c:292 | 257 | #: init/job_process.c:289 |
894 | 193 | #, c-format | 258 | #, c-format |
895 | 194 | msgid "%s %s process (%d)" | 259 | msgid "%s %s process (%d)" |
896 | 195 | msgstr "" | 260 | msgstr "" |
897 | 196 | 261 | ||
899 | 197 | #: init/job_process.c:399 | 262 | #: init/job_process.c:402 |
900 | 198 | #, c-format | 263 | #, c-format |
901 | 199 | msgid "Pausing %s (%d) [pre-exec] for debug" | 264 | msgid "Pausing %s (%d) [pre-exec] for debug" |
902 | 200 | msgstr "" | 265 | msgstr "" |
903 | 201 | 266 | ||
905 | 202 | #: init/job_process.c:453 | 267 | #: init/job_process.c:472 |
906 | 203 | #, c-format | 268 | #, c-format |
907 | 204 | msgid "Failed to open system console: %s" | 269 | msgid "Failed to open system console: %s" |
908 | 205 | msgstr "" | 270 | msgstr "" |
909 | 206 | 271 | ||
911 | 207 | #: init/job_process.c:669 | 272 | #: init/job_process.c:696 |
912 | 273 | #, c-format | ||
913 | 274 | msgid "unable to move script fd: %s" | ||
914 | 275 | msgstr "" | ||
915 | 276 | |||
916 | 277 | #: init/job_process.c:701 | ||
917 | 208 | #, c-format | 278 | #, c-format |
918 | 209 | msgid "unable to open console: %s" | 279 | msgid "unable to open console: %s" |
919 | 210 | msgstr "" | 280 | msgstr "" |
920 | 211 | 281 | ||
922 | 212 | #: init/job_process.c:724 | 282 | #: init/job_process.c:756 |
923 | 213 | #, c-format | 283 | #, c-format |
924 | 214 | msgid "unable to set \"%s\" resource limit: %s" | 284 | msgid "unable to set \"%s\" resource limit: %s" |
925 | 215 | msgstr "" | 285 | msgstr "" |
926 | 216 | 286 | ||
928 | 217 | #: init/job_process.c:729 | 287 | #: init/job_process.c:761 |
929 | 218 | #, c-format | 288 | #, c-format |
930 | 219 | msgid "unable to set priority: %s" | 289 | msgid "unable to set priority: %s" |
931 | 220 | msgstr "" | 290 | msgstr "" |
932 | 221 | 291 | ||
934 | 222 | #: init/job_process.c:734 | 292 | #: init/job_process.c:766 |
935 | 223 | #, c-format | 293 | #, c-format |
936 | 224 | msgid "unable to set oom adjustment: %s" | 294 | msgid "unable to set oom adjustment: %s" |
937 | 225 | msgstr "" | 295 | msgstr "" |
938 | 226 | 296 | ||
940 | 227 | #: init/job_process.c:739 | 297 | #: init/job_process.c:771 |
941 | 228 | #, c-format | 298 | #, c-format |
942 | 229 | msgid "unable to change root directory: %s" | 299 | msgid "unable to change root directory: %s" |
943 | 230 | msgstr "" | 300 | msgstr "" |
944 | 231 | 301 | ||
946 | 232 | #: init/job_process.c:744 | 302 | #: init/job_process.c:776 |
947 | 233 | #, c-format | 303 | #, c-format |
948 | 234 | msgid "unable to change working directory: %s" | 304 | msgid "unable to change working directory: %s" |
949 | 235 | msgstr "" | 305 | msgstr "" |
950 | 236 | 306 | ||
952 | 237 | #: init/job_process.c:749 | 307 | #: init/job_process.c:781 |
953 | 238 | #, c-format | 308 | #, c-format |
954 | 239 | msgid "unable to set trace: %s" | 309 | msgid "unable to set trace: %s" |
955 | 240 | msgstr "" | 310 | msgstr "" |
956 | 241 | 311 | ||
958 | 242 | #: init/job_process.c:754 | 312 | #: init/job_process.c:786 |
959 | 243 | #, c-format | 313 | #, c-format |
960 | 244 | msgid "unable to execute: %s" | 314 | msgid "unable to execute: %s" |
961 | 245 | msgstr "" | 315 | msgstr "" |
962 | 246 | 316 | ||
984 | 247 | #: init/job_process.c:785 | 317 | #: init/job_process.c:817 init/job_process.c:867 |
985 | 248 | #, c-format | 318 | #, c-format |
986 | 249 | msgid "Sending TERM signal to %s %s process (%d)" | 319 | msgid "Sending %s signal to %s %s process (%d)" |
987 | 250 | msgstr "" | 320 | msgstr "" |
988 | 251 | 321 | ||
989 | 252 | #: init/job_process.c:793 | 322 | #: init/job_process.c:826 init/job_process.c:876 |
990 | 253 | #, c-format | 323 | #, c-format |
991 | 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" |
992 | 255 | msgstr "" | 325 | msgstr "" |
993 | 256 | 326 | ||
994 | 257 | #: init/job_process.c:833 | 327 | #: init/job_process.c:937 |
974 | 258 | #, c-format | ||
975 | 259 | msgid "Sending KILL signal to %s %s process (%d)" | ||
976 | 260 | msgstr "" | ||
977 | 261 | |||
978 | 262 | #: init/job_process.c:841 | ||
979 | 263 | #, c-format | ||
980 | 264 | msgid "Failed to send KILL signal to %s %s process (%d): %s" | ||
981 | 265 | msgstr "" | ||
982 | 266 | |||
983 | 267 | #: init/job_process.c:901 | ||
995 | 268 | #, c-format | 328 | #, c-format |
996 | 269 | msgid "%s %s process (%d) terminated with status %d" | 329 | msgid "%s %s process (%d) terminated with status %d" |
997 | 270 | msgstr "" | 330 | msgstr "" |
998 | 271 | 331 | ||
1000 | 272 | #: init/job_process.c:906 | 332 | #: init/job_process.c:942 |
1001 | 273 | #, c-format | 333 | #, c-format |
1002 | 274 | msgid "%s %s process (%d) exited normally" | 334 | msgid "%s %s process (%d) exited normally" |
1003 | 275 | msgstr "" | 335 | msgstr "" |
1004 | 276 | 336 | ||
1006 | 277 | #: init/job_process.c:921 | 337 | #: init/job_process.c:957 |
1007 | 278 | #, c-format | 338 | #, c-format |
1008 | 279 | msgid "%s %s process (%d) killed by %s signal" | 339 | msgid "%s %s process (%d) killed by %s signal" |
1009 | 280 | msgstr "" | 340 | msgstr "" |
1010 | 281 | 341 | ||
1012 | 282 | #: init/job_process.c:925 | 342 | #: init/job_process.c:961 |
1013 | 283 | #, c-format | 343 | #, c-format |
1014 | 284 | msgid "%s %s process (%d) killed by signal %d" | 344 | msgid "%s %s process (%d) killed by signal %d" |
1015 | 285 | msgstr "" | 345 | msgstr "" |
1016 | 286 | 346 | ||
1018 | 287 | #: init/job_process.c:939 | 347 | #: init/job_process.c:975 |
1019 | 288 | #, c-format | 348 | #, c-format |
1020 | 289 | msgid "%s %s process (%d) stopped by %s signal" | 349 | msgid "%s %s process (%d) stopped by %s signal" |
1021 | 290 | msgstr "" | 350 | msgstr "" |
1022 | 291 | 351 | ||
1024 | 292 | #: init/job_process.c:943 | 352 | #: init/job_process.c:979 |
1025 | 293 | #, c-format | 353 | #, c-format |
1026 | 294 | msgid "%s %s process (%d) stopped by signal %d" | 354 | msgid "%s %s process (%d) stopped by signal %d" |
1027 | 295 | msgstr "" | 355 | msgstr "" |
1028 | 296 | 356 | ||
1030 | 297 | #: init/job_process.c:957 | 357 | #: init/job_process.c:993 |
1031 | 298 | #, c-format | 358 | #, c-format |
1032 | 299 | msgid "%s %s process (%d) continued by %s signal" | 359 | msgid "%s %s process (%d) continued by %s signal" |
1033 | 300 | msgstr "" | 360 | msgstr "" |
1034 | 301 | 361 | ||
1036 | 302 | #: init/job_process.c:961 | 362 | #: init/job_process.c:997 |
1037 | 303 | #, c-format | 363 | #, c-format |
1038 | 304 | msgid "%s %s process (%d) continued by signal %d" | 364 | msgid "%s %s process (%d) continued by signal %d" |
1039 | 305 | msgstr "" | 365 | msgstr "" |
1040 | 306 | 366 | ||
1042 | 307 | #: init/job_process.c:1096 | 367 | #: init/job_process.c:1132 |
1043 | 308 | #, c-format | 368 | #, c-format |
1044 | 309 | msgid "%s respawning too fast, stopped" | 369 | msgid "%s respawning too fast, stopped" |
1045 | 310 | msgstr "" | 370 | msgstr "" |
1046 | 311 | 371 | ||
1048 | 312 | #: init/job_process.c:1102 | 372 | #: init/job_process.c:1138 |
1049 | 313 | #, c-format | 373 | #, c-format |
1050 | 314 | msgid "%s %s process ended, respawning" | 374 | msgid "%s %s process ended, respawning" |
1051 | 315 | msgstr "" | 375 | msgstr "" |
1052 | 316 | 376 | ||
1054 | 317 | #: init/job_process.c:1342 | 377 | #: init/job_process.c:1378 |
1055 | 318 | #, c-format | 378 | #, c-format |
1056 | 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" |
1057 | 320 | msgstr "" | 380 | msgstr "" |
1058 | 321 | 381 | ||
1060 | 322 | #: init/job_process.c:1355 init/job_process.c:1550 | 382 | #: init/job_process.c:1391 init/job_process.c:1586 |
1061 | 323 | #, c-format | 383 | #, c-format |
1062 | 324 | msgid "Failed to continue traced %s %s process (%d): %s" | 384 | msgid "Failed to continue traced %s %s process (%d): %s" |
1063 | 325 | msgstr "" | 385 | msgstr "" |
1064 | 326 | 386 | ||
1066 | 327 | #: init/job_process.c:1395 init/job_process.c:1486 init/job_process.c:1541 | 387 | #: init/job_process.c:1431 init/job_process.c:1522 init/job_process.c:1577 |
1067 | 328 | #, c-format | 388 | #, c-format |
1068 | 329 | msgid "Failed to detach traced %s %s process (%d): %s" | 389 | msgid "Failed to detach traced %s %s process (%d): %s" |
1069 | 330 | msgstr "" | 390 | msgstr "" |
1070 | 331 | 391 | ||
1072 | 332 | #: init/job_process.c:1435 | 392 | #: init/job_process.c:1471 |
1073 | 333 | #, c-format | 393 | #, c-format |
1074 | 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" |
1075 | 335 | msgstr "" | 395 | msgstr "" |
1076 | 336 | 396 | ||
1078 | 337 | #: init/job_process.c:1470 | 397 | #: init/job_process.c:1506 |
1079 | 338 | #, c-format | 398 | #, c-format |
1080 | 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" |
1081 | 340 | msgstr "" | 400 | msgstr "" |
1082 | 341 | 401 | ||
1084 | 342 | #: init/job_process.c:1477 | 402 | #: init/job_process.c:1513 |
1085 | 343 | #, c-format | 403 | #, c-format |
1086 | 344 | msgid "%s %s process (%d) became new process (%d)" | 404 | msgid "%s %s process (%d) became new process (%d)" |
1087 | 345 | msgstr "" | 405 | msgstr "" |
1088 | 346 | 406 | ||
1090 | 347 | #: init/job_process.c:1536 | 407 | #: init/job_process.c:1572 |
1091 | 348 | #, c-format | 408 | #, c-format |
1092 | 349 | msgid "%s %s process (%d) executable changed" | 409 | msgid "%s %s process (%d) executable changed" |
1093 | 350 | msgstr "" | 410 | msgstr "" |
1094 | 351 | 411 | ||
1096 | 352 | #: init/main.c:117 | 412 | #: init/main.c:100 |
1097 | 413 | msgid "use D-Bus session bus rather than system bus (for testing)" | ||
1098 | 414 | msgstr "" | ||
1099 | 415 | |||
1100 | 416 | #: init/main.c:120 | ||
1101 | 353 | msgid "Process management daemon." | 417 | msgid "Process management daemon." |
1102 | 354 | msgstr "" | 418 | msgstr "" |
1103 | 355 | 419 | ||
1105 | 356 | #: init/main.c:119 | 420 | #: init/main.c:122 |
1106 | 357 | msgid "" | 421 | msgid "" |
1107 | 358 | "This daemon is normally executed by the kernel and given process id 1 to " | 422 | "This daemon is normally executed by the kernel and given process id 1 to " |
1108 | 359 | "denote its special status. When executed by a user process, it will " | 423 | "denote its special status. When executed by a user process, it will " |
1109 | 360 | "actually run /sbin/telinit." | 424 | "actually run /sbin/telinit." |
1110 | 361 | msgstr "" | 425 | msgstr "" |
1111 | 362 | 426 | ||
1113 | 363 | #: init/main.c:130 util/reboot.c:167 util/shutdown.c:363 util/telinit.c:148 | 427 | #: init/main.c:137 util/reboot.c:166 util/shutdown.c:363 util/telinit.c:148 |
1114 | 364 | msgid "Need to be root" | 428 | msgid "Need to be root" |
1115 | 365 | msgstr "" | 429 | msgstr "" |
1116 | 366 | 430 | ||
1118 | 367 | #: init/main.c:139 | 431 | #: init/main.c:146 |
1119 | 368 | msgid "Not being executed as init" | 432 | msgid "Not being executed as init" |
1120 | 369 | msgstr "" | 433 | msgstr "" |
1121 | 370 | 434 | ||
1123 | 371 | #: init/main.c:187 init/main.c:456 | 435 | #: init/main.c:194 init/main.c:477 |
1124 | 372 | msgid "Unable to set root directory" | 436 | msgid "Unable to set root directory" |
1125 | 373 | msgstr "" | 437 | msgstr "" |
1126 | 374 | 438 | ||
1128 | 375 | #: init/main.c:198 | 439 | #: init/main.c:205 |
1129 | 376 | msgid "Unable to mount /proc filesystem" | 440 | msgid "Unable to mount /proc filesystem" |
1130 | 377 | msgstr "" | 441 | msgstr "" |
1131 | 378 | 442 | ||
1133 | 379 | #: init/main.c:207 | 443 | #: init/main.c:214 |
1134 | 380 | msgid "Unable to mount /sys filesystem" | 444 | msgid "Unable to mount /sys filesystem" |
1135 | 381 | msgstr "" | 445 | msgstr "" |
1136 | 382 | 446 | ||
1138 | 383 | #: init/main.c:292 | 447 | #: init/main.c:310 |
1139 | 384 | msgid "Unable to listen for private connections" | 448 | msgid "Unable to listen for private connections" |
1140 | 385 | msgstr "" | 449 | msgstr "" |
1141 | 386 | 450 | ||
1143 | 387 | #: init/main.c:473 | 451 | #: init/main.c:494 |
1144 | 388 | #, c-format | 452 | #, c-format |
1145 | 389 | msgid "Caught %s, core dumped" | 453 | msgid "Caught %s, core dumped" |
1146 | 390 | msgstr "" | 454 | msgstr "" |
1147 | 391 | 455 | ||
1149 | 392 | #: init/main.c:477 | 456 | #: init/main.c:498 |
1150 | 393 | #, c-format | 457 | #, c-format |
1151 | 394 | msgid "Caught %s, unable to dump core" | 458 | msgid "Caught %s, unable to dump core" |
1152 | 395 | msgstr "" | 459 | msgstr "" |
1153 | 396 | 460 | ||
1155 | 397 | #: init/main.c:563 | 461 | #: init/main.c:584 |
1156 | 398 | msgid "Reconnecting to system bus" | 462 | msgid "Reconnecting to system bus" |
1157 | 399 | msgstr "" | 463 | msgstr "" |
1158 | 400 | 464 | ||
1160 | 401 | #: init/main.c:569 | 465 | #: init/main.c:590 |
1161 | 402 | msgid "Unable to connect to the system bus" | 466 | msgid "Unable to connect to the system bus" |
1162 | 403 | msgstr "" | 467 | msgstr "" |
1163 | 404 | 468 | ||
1164 | @@ -406,76 +470,84 @@ | |||
1165 | 406 | msgid "main" | 470 | msgid "main" |
1166 | 407 | msgstr "" | 471 | msgstr "" |
1167 | 408 | 472 | ||
1169 | 409 | #: util/initctl.c:145 | 473 | #: util/initctl.c:185 |
1170 | 410 | msgid "Unable to connect to system bus" | 474 | msgid "Unable to connect to system bus" |
1171 | 411 | msgstr "" | 475 | msgstr "" |
1172 | 412 | 476 | ||
1174 | 413 | #: util/initctl.c:154 | 477 | #: util/initctl.c:186 |
1175 | 478 | msgid "Unable to connect to session bus" | ||
1176 | 479 | msgstr "" | ||
1177 | 480 | |||
1178 | 481 | #: util/initctl.c:195 | ||
1179 | 414 | #, c-format | 482 | #, c-format |
1180 | 415 | msgid "%s: --dest given without --system\n" | 483 | msgid "%s: --dest given without --system\n" |
1181 | 416 | msgstr "" | 484 | msgstr "" |
1182 | 417 | 485 | ||
1184 | 418 | #: util/initctl.c:162 | 486 | #: util/initctl.c:203 |
1185 | 419 | msgid "Unable to connect to Upstart" | 487 | msgid "Unable to connect to Upstart" |
1186 | 420 | msgstr "" | 488 | msgstr "" |
1187 | 421 | 489 | ||
1190 | 422 | #: util/initctl.c:348 util/initctl.c:483 util/initctl.c:611 util/initctl.c:745 | 490 | #: util/initctl.c:389 util/initctl.c:524 util/initctl.c:652 util/initctl.c:786 |
1191 | 423 | #: util/initctl.c:850 | 491 | #: util/initctl.c:891 |
1192 | 424 | #, c-format | 492 | #, c-format |
1193 | 425 | msgid "%s: missing job name\n" | 493 | msgid "%s: missing job name\n" |
1194 | 426 | msgstr "" | 494 | msgstr "" |
1195 | 427 | 495 | ||
1197 | 428 | #: util/initctl.c:796 | 496 | #: util/initctl.c:837 |
1198 | 429 | msgid "Not running" | 497 | msgid "Not running" |
1199 | 430 | msgstr "" | 498 | msgstr "" |
1200 | 431 | 499 | ||
1202 | 432 | #: util/initctl.c:1065 | 500 | #: util/initctl.c:1106 |
1203 | 433 | #, c-format | 501 | #, c-format |
1204 | 434 | msgid "%s: missing event name\n" | 502 | msgid "%s: missing event name\n" |
1205 | 435 | msgstr "" | 503 | msgstr "" |
1206 | 436 | 504 | ||
1208 | 437 | #: util/initctl.c:1261 | 505 | #: util/initctl.c:1302 |
1209 | 506 | msgid "use D-Bus session bus to connect to init daemon (for testing)" | ||
1210 | 507 | msgstr "" | ||
1211 | 508 | |||
1212 | 509 | #: util/initctl.c:1304 | ||
1213 | 438 | msgid "use D-Bus system bus to connect to init daemon" | 510 | msgid "use D-Bus system bus to connect to init daemon" |
1214 | 439 | msgstr "" | 511 | msgstr "" |
1215 | 440 | 512 | ||
1218 | 441 | #: util/initctl.c:1263 | 513 | #: util/initctl.c:1306 |
1219 | 442 | msgid "destination well-known name on system bus" | 514 | msgid "destination well-known name on D-Bus bus" |
1220 | 443 | msgstr "" | 515 | msgstr "" |
1221 | 444 | 516 | ||
1223 | 445 | #: util/initctl.c:1276 | 517 | #: util/initctl.c:1319 |
1224 | 446 | msgid "do not wait for job to start before exiting" | 518 | msgid "do not wait for job to start before exiting" |
1225 | 447 | msgstr "" | 519 | msgstr "" |
1226 | 448 | 520 | ||
1228 | 449 | #: util/initctl.c:1288 | 521 | #: util/initctl.c:1331 |
1229 | 450 | msgid "do not wait for job to stop before exiting" | 522 | msgid "do not wait for job to stop before exiting" |
1230 | 451 | msgstr "" | 523 | msgstr "" |
1231 | 452 | 524 | ||
1233 | 453 | #: util/initctl.c:1300 | 525 | #: util/initctl.c:1343 |
1234 | 454 | msgid "do not wait for job to restart before exiting" | 526 | msgid "do not wait for job to restart before exiting" |
1235 | 455 | msgstr "" | 527 | msgstr "" |
1236 | 456 | 528 | ||
1238 | 457 | #: util/initctl.c:1339 | 529 | #: util/initctl.c:1382 |
1239 | 458 | msgid "do not wait for event to finish before exiting" | 530 | msgid "do not wait for event to finish before exiting" |
1240 | 459 | msgstr "" | 531 | msgstr "" |
1241 | 460 | 532 | ||
1243 | 461 | #: util/initctl.c:1378 | 533 | #: util/initctl.c:1421 |
1244 | 462 | msgid "Job" | 534 | msgid "Job" |
1245 | 463 | msgstr "" | 535 | msgstr "" |
1246 | 464 | 536 | ||
1248 | 465 | #: util/initctl.c:1385 | 537 | #: util/initctl.c:1428 |
1249 | 466 | msgid "Event" | 538 | msgid "Event" |
1250 | 467 | msgstr "" | 539 | msgstr "" |
1251 | 468 | 540 | ||
1254 | 469 | #: util/initctl.c:1393 util/initctl.c:1405 util/initctl.c:1416 | 541 | #: util/initctl.c:1436 util/initctl.c:1448 util/initctl.c:1459 |
1255 | 470 | #: util/initctl.c:1427 util/initctl.c:1434 | 542 | #: util/initctl.c:1470 util/initctl.c:1477 |
1256 | 471 | msgid "JOB [KEY=VALUE]..." | 543 | msgid "JOB [KEY=VALUE]..." |
1257 | 472 | msgstr "" | 544 | msgstr "" |
1258 | 473 | 545 | ||
1260 | 474 | #: util/initctl.c:1394 | 546 | #: util/initctl.c:1437 |
1261 | 475 | msgid "Start job." | 547 | msgid "Start job." |
1262 | 476 | msgstr "" | 548 | msgstr "" |
1263 | 477 | 549 | ||
1265 | 478 | #: util/initctl.c:1395 | 550 | #: util/initctl.c:1438 |
1266 | 479 | msgid "" | 551 | msgid "" |
1267 | 480 | "JOB is the name of the job that is to be started, this may be followed by " | 552 | "JOB is the name of the job that is to be started, this may be followed by " |
1268 | 481 | "zero or more environment variables to be defined in the new job.\n" | 553 | "zero or more environment variables to be defined in the new job.\n" |
1269 | @@ -485,11 +557,11 @@ | |||
1270 | 485 | "an existing instance is already running." | 557 | "an existing instance is already running." |
1271 | 486 | msgstr "" | 558 | msgstr "" |
1272 | 487 | 559 | ||
1274 | 488 | #: util/initctl.c:1406 | 560 | #: util/initctl.c:1449 |
1275 | 489 | msgid "Stop job." | 561 | msgid "Stop job." |
1276 | 490 | msgstr "" | 562 | msgstr "" |
1277 | 491 | 563 | ||
1279 | 492 | #: util/initctl.c:1407 | 564 | #: util/initctl.c:1450 |
1280 | 493 | msgid "" | 565 | msgid "" |
1281 | 494 | "JOB is the name of the job that is to be stopped, this may be followed by " | 566 | "JOB is the name of the job that is to be stopped, this may be followed by " |
1282 | 495 | "zero or more environment variables to be passed to the job's pre-stop and " | 567 | "zero or more environment variables to be passed to the job's pre-stop and " |
1283 | @@ -499,11 +571,11 @@ | |||
1284 | 499 | "decide which of multiple instances will be stopped." | 571 | "decide which of multiple instances will be stopped." |
1285 | 500 | msgstr "" | 572 | msgstr "" |
1286 | 501 | 573 | ||
1288 | 502 | #: util/initctl.c:1417 | 574 | #: util/initctl.c:1460 |
1289 | 503 | msgid "Restart job." | 575 | msgid "Restart job." |
1290 | 504 | msgstr "" | 576 | msgstr "" |
1291 | 505 | 577 | ||
1293 | 506 | #: util/initctl.c:1418 | 578 | #: util/initctl.c:1461 |
1294 | 507 | msgid "" | 579 | msgid "" |
1295 | 508 | "JOB is the name of the job that is to be restarted, this may be followed by " | 580 | "JOB is the name of the job that is to be restarted, this may be followed by " |
1296 | 509 | "zero or more environment variables to be defined in the job after " | 581 | "zero or more environment variables to be defined in the job after " |
1297 | @@ -513,66 +585,66 @@ | |||
1298 | 513 | "decide which of multiple instances will be restarted." | 585 | "decide which of multiple instances will be restarted." |
1299 | 514 | msgstr "" | 586 | msgstr "" |
1300 | 515 | 587 | ||
1302 | 516 | #: util/initctl.c:1428 | 588 | #: util/initctl.c:1471 |
1303 | 517 | msgid "Send HUP signal to job." | 589 | msgid "Send HUP signal to job." |
1304 | 518 | msgstr "" | 590 | msgstr "" |
1305 | 519 | 591 | ||
1307 | 520 | #: util/initctl.c:1429 | 592 | #: util/initctl.c:1472 |
1308 | 521 | msgid "" | 593 | msgid "" |
1309 | 522 | "JOB is the name of the job that is to be sent the signal, this may be " | 594 | "JOB is the name of the job that is to be sent the signal, this may be " |
1310 | 523 | "followed by zero or more environment variables to distinguish between job " | 595 | "followed by zero or more environment variables to distinguish between job " |
1311 | 524 | "instances.\n" | 596 | "instances.\n" |
1312 | 525 | msgstr "" | 597 | msgstr "" |
1313 | 526 | 598 | ||
1315 | 527 | #: util/initctl.c:1435 | 599 | #: util/initctl.c:1478 |
1316 | 528 | msgid "Query status of job." | 600 | msgid "Query status of job." |
1317 | 529 | msgstr "" | 601 | msgstr "" |
1318 | 530 | 602 | ||
1320 | 531 | #: util/initctl.c:1436 | 603 | #: util/initctl.c:1479 |
1321 | 532 | msgid "" | 604 | msgid "" |
1322 | 533 | "JOB is the name of the job that is to be queried, this may be followed by " | 605 | "JOB is the name of the job that is to be queried, this may be followed by " |
1323 | 534 | "zero or more environment variables to distguish between job instances.\n" | 606 | "zero or more environment variables to distguish between job instances.\n" |
1324 | 535 | msgstr "" | 607 | msgstr "" |
1325 | 536 | 608 | ||
1327 | 537 | #: util/initctl.c:1442 | 609 | #: util/initctl.c:1485 |
1328 | 538 | msgid "List known jobs." | 610 | msgid "List known jobs." |
1329 | 539 | msgstr "" | 611 | msgstr "" |
1330 | 540 | 612 | ||
1332 | 541 | #: util/initctl.c:1443 | 613 | #: util/initctl.c:1486 |
1333 | 542 | msgid "The known jobs and their current status will be output." | 614 | msgid "The known jobs and their current status will be output." |
1334 | 543 | msgstr "" | 615 | msgstr "" |
1335 | 544 | 616 | ||
1337 | 545 | #: util/initctl.c:1446 | 617 | #: util/initctl.c:1489 |
1338 | 546 | msgid "EVENT [KEY=VALUE]..." | 618 | msgid "EVENT [KEY=VALUE]..." |
1339 | 547 | msgstr "" | 619 | msgstr "" |
1340 | 548 | 620 | ||
1342 | 549 | #: util/initctl.c:1447 | 621 | #: util/initctl.c:1490 |
1343 | 550 | msgid "Emit an event." | 622 | msgid "Emit an event." |
1344 | 551 | msgstr "" | 623 | msgstr "" |
1345 | 552 | 624 | ||
1347 | 553 | #: util/initctl.c:1448 | 625 | #: util/initctl.c:1491 |
1348 | 554 | msgid "" | 626 | msgid "" |
1349 | 555 | "EVENT is the name of an event the init daemon should emit, this may be " | 627 | "EVENT is the name of an event the init daemon should emit, this may be " |
1350 | 556 | "followed by zero or more environment variables to be included in the event.\n" | 628 | "followed by zero or more environment variables to be included in the event.\n" |
1351 | 557 | msgstr "" | 629 | msgstr "" |
1352 | 558 | 630 | ||
1354 | 559 | #: util/initctl.c:1454 | 631 | #: util/initctl.c:1497 |
1355 | 560 | msgid "Reload the configuration of the init daemon." | 632 | msgid "Reload the configuration of the init daemon." |
1356 | 561 | msgstr "" | 633 | msgstr "" |
1357 | 562 | 634 | ||
1359 | 563 | #: util/initctl.c:1458 | 635 | #: util/initctl.c:1501 |
1360 | 564 | msgid "Request the version of the init daemon." | 636 | msgid "Request the version of the init daemon." |
1361 | 565 | msgstr "" | 637 | msgstr "" |
1362 | 566 | 638 | ||
1364 | 567 | #: util/initctl.c:1461 | 639 | #: util/initctl.c:1504 |
1365 | 568 | msgid "[PRIORITY]" | 640 | msgid "[PRIORITY]" |
1366 | 569 | msgstr "" | 641 | msgstr "" |
1367 | 570 | 642 | ||
1369 | 571 | #: util/initctl.c:1462 | 643 | #: util/initctl.c:1505 |
1370 | 572 | msgid "Change the minimum priority of log messages from the init daemon" | 644 | msgid "Change the minimum priority of log messages from the init daemon" |
1371 | 573 | msgstr "" | 645 | msgstr "" |
1372 | 574 | 646 | ||
1374 | 575 | #: util/initctl.c:1464 | 647 | #: util/initctl.c:1507 |
1375 | 576 | msgid "" | 648 | msgid "" |
1376 | 577 | "PRIORITY may be one of:\n" | 649 | "PRIORITY may be one of:\n" |
1377 | 578 | " `debug' (messages useful for debugging upstart are logged, equivalent to --" | 650 | " `debug' (messages useful for debugging upstart are logged, equivalent to --" |
1378 | @@ -589,59 +661,59 @@ | |||
1379 | 589 | "Without arguments, this outputs the current log priority." | 661 | "Without arguments, this outputs the current log priority." |
1380 | 590 | msgstr "" | 662 | msgstr "" |
1381 | 591 | 663 | ||
1383 | 592 | #: util/reboot.c:114 | 664 | #: util/reboot.c:113 |
1384 | 593 | msgid "don't sync before reboot or halt" | 665 | msgid "don't sync before reboot or halt" |
1385 | 594 | msgstr "" | 666 | msgstr "" |
1386 | 595 | 667 | ||
1388 | 596 | #: util/reboot.c:116 | 668 | #: util/reboot.c:115 |
1389 | 597 | msgid "force reboot or halt, don't call shutdown(8)" | 669 | msgid "force reboot or halt, don't call shutdown(8)" |
1390 | 598 | msgstr "" | 670 | msgstr "" |
1391 | 599 | 671 | ||
1393 | 600 | #: util/reboot.c:118 | 672 | #: util/reboot.c:117 |
1394 | 601 | msgid "switch off the power when called as halt" | 673 | msgid "switch off the power when called as halt" |
1395 | 602 | msgstr "" | 674 | msgstr "" |
1396 | 603 | 675 | ||
1398 | 604 | #: util/reboot.c:120 | 676 | #: util/reboot.c:119 |
1399 | 605 | msgid "don't actually reboot or halt, just write wtmp record" | 677 | msgid "don't actually reboot or halt, just write wtmp record" |
1400 | 606 | msgstr "" | 678 | msgstr "" |
1401 | 607 | 679 | ||
1403 | 608 | #: util/reboot.c:145 | 680 | #: util/reboot.c:144 |
1404 | 609 | msgid "Halt the system." | 681 | msgid "Halt the system." |
1405 | 610 | msgstr "" | 682 | msgstr "" |
1406 | 611 | 683 | ||
1408 | 612 | #: util/reboot.c:148 | 684 | #: util/reboot.c:147 |
1409 | 613 | msgid "Power off the system." | 685 | msgid "Power off the system." |
1410 | 614 | msgstr "" | 686 | msgstr "" |
1411 | 615 | 687 | ||
1413 | 616 | #: util/reboot.c:151 | 688 | #: util/reboot.c:150 |
1414 | 617 | msgid "Reboot the system." | 689 | msgid "Reboot the system." |
1415 | 618 | msgstr "" | 690 | msgstr "" |
1416 | 619 | 691 | ||
1418 | 620 | #: util/reboot.c:155 | 692 | #: util/reboot.c:154 |
1419 | 621 | msgid "" | 693 | msgid "" |
1420 | 622 | "This command is intended to instruct the kernel to reboot or halt the " | 694 | "This command is intended to instruct the kernel to reboot or halt the " |
1421 | 623 | "system; when run without the -f option, or when in a system runlevel other " | 695 | "system; when run without the -f option, or when in a system runlevel other " |
1422 | 624 | "than 0 or 6, it will actually execute /sbin/shutdown.\n" | 696 | "than 0 or 6, it will actually execute /sbin/shutdown.\n" |
1423 | 625 | msgstr "" | 697 | msgstr "" |
1424 | 626 | 698 | ||
1426 | 627 | #: util/reboot.c:211 | 699 | #: util/reboot.c:210 |
1427 | 628 | msgid "Calling shutdown" | 700 | msgid "Calling shutdown" |
1428 | 629 | msgstr "" | 701 | msgstr "" |
1429 | 630 | 702 | ||
1431 | 631 | #: util/reboot.c:214 | 703 | #: util/reboot.c:213 |
1432 | 632 | #, c-format | 704 | #, c-format |
1433 | 633 | msgid "Unable to execute shutdown: %s" | 705 | msgid "Unable to execute shutdown: %s" |
1434 | 634 | msgstr "" | 706 | msgstr "" |
1435 | 635 | 707 | ||
1437 | 636 | #: util/reboot.c:235 | 708 | #: util/reboot.c:234 |
1438 | 637 | msgid "Rebooting" | 709 | msgid "Rebooting" |
1439 | 638 | msgstr "" | 710 | msgstr "" |
1440 | 639 | 711 | ||
1442 | 640 | #: util/reboot.c:239 | 712 | #: util/reboot.c:238 |
1443 | 641 | msgid "Halting" | 713 | msgid "Halting" |
1444 | 642 | msgstr "" | 714 | msgstr "" |
1445 | 643 | 715 | ||
1447 | 644 | #: util/reboot.c:243 | 716 | #: util/reboot.c:242 |
1448 | 645 | msgid "Powering off" | 717 | msgid "Powering off" |
1449 | 646 | msgstr "" | 718 | msgstr "" |
1450 | 647 | 719 | ||
1451 | 648 | 720 | ||
1452 | === modified file 'util/initctl.c' | |||
1453 | --- util/initctl.c 2010-02-04 19:08:07 +0000 | |||
1454 | +++ util/initctl.c 2011-06-03 09:21:18 +0000 | |||
1455 | @@ -63,6 +63,11 @@ | |||
1456 | 63 | static void reply_handler (int *ret, NihDBusMessage *message); | 63 | static void reply_handler (int *ret, NihDBusMessage *message); |
1457 | 64 | static void error_handler (void *data, NihDBusMessage *message); | 64 | static void error_handler (void *data, NihDBusMessage *message); |
1458 | 65 | 65 | ||
1459 | 66 | #ifndef TEST | ||
1460 | 67 | |||
1461 | 68 | static int dbus_bus_type_setter (NihOption *option, const char *arg); | ||
1462 | 69 | |||
1463 | 70 | #endif | ||
1464 | 66 | 71 | ||
1465 | 67 | /* Prototypes for option and command functions */ | 72 | /* Prototypes for option and command functions */ |
1466 | 68 | int start_action (NihCommand *command, char * const *args); | 73 | int start_action (NihCommand *command, char * const *args); |
1467 | @@ -78,12 +83,21 @@ | |||
1468 | 78 | 83 | ||
1469 | 79 | 84 | ||
1470 | 80 | /** | 85 | /** |
1477 | 81 | * system_bus: | 86 | * use_dbus: |
1478 | 82 | * | 87 | * |
1479 | 83 | * Whether to connect to the init daemon on the D-Bus system bus or | 88 | * If 1, connect using a D-Bus bus. |
1480 | 84 | * privately. | 89 | * If 0, connect using private connection. |
1481 | 85 | **/ | 90 | * If -1, determine appropriate connection based on UID. |
1482 | 86 | int system_bus = -1; | 91 | */ |
1483 | 92 | int use_dbus = -1; | ||
1484 | 93 | |||
1485 | 94 | /** | ||
1486 | 95 | * dbus_bus_type: | ||
1487 | 96 | * | ||
1488 | 97 | * D-Bus bus to connect to (DBUS_BUS_SYSTEM or DBUS_BUS_SESSION), or -1 | ||
1489 | 98 | * to have an appropriate bus selected. | ||
1490 | 99 | */ | ||
1491 | 100 | int dbus_bus_type = -1; | ||
1492 | 87 | 101 | ||
1493 | 88 | /** | 102 | /** |
1494 | 89 | * dest_name: | 103 | * dest_name: |
1495 | @@ -107,6 +121,28 @@ | |||
1496 | 107 | **/ | 121 | **/ |
1497 | 108 | int no_wait = FALSE; | 122 | int no_wait = FALSE; |
1498 | 109 | 123 | ||
1499 | 124 | /** | ||
1500 | 125 | * NihOption setter function to handle selection of appropriate D-Bus | ||
1501 | 126 | * bus. | ||
1502 | 127 | * | ||
1503 | 128 | * Always returns 1 denoting success. | ||
1504 | 129 | **/ | ||
1505 | 130 | int | ||
1506 | 131 | dbus_bus_type_setter (NihOption *option, const char *arg) | ||
1507 | 132 | { | ||
1508 | 133 | nih_assert (option); | ||
1509 | 134 | |||
1510 | 135 | if (! strcmp (option->long_option, "system")) { | ||
1511 | 136 | use_dbus = TRUE; | ||
1512 | 137 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1513 | 138 | } | ||
1514 | 139 | else if (! strcmp (option->long_option, "session")) { | ||
1515 | 140 | use_dbus = TRUE; | ||
1516 | 141 | dbus_bus_type = DBUS_BUS_SESSION; | ||
1517 | 142 | } | ||
1518 | 143 | |||
1519 | 144 | return 1; | ||
1520 | 145 | } | ||
1521 | 110 | 146 | ||
1522 | 111 | /** | 147 | /** |
1523 | 112 | * upstart_open: | 148 | * upstart_open: |
1524 | @@ -132,17 +168,22 @@ | |||
1525 | 132 | DBusConnection *connection; | 168 | DBusConnection *connection; |
1526 | 133 | NihDBusProxy * upstart; | 169 | NihDBusProxy * upstart; |
1527 | 134 | 170 | ||
1530 | 135 | if (system_bus < 0) | 171 | if (use_dbus < 0) |
1531 | 136 | system_bus = getuid () ? TRUE : FALSE; | 172 | use_dbus = getuid () ? TRUE : FALSE; |
1532 | 173 | if (use_dbus >= 0 && dbus_bus_type < 0) | ||
1533 | 174 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1534 | 137 | 175 | ||
1535 | 138 | dbus_error_init (&dbus_error); | 176 | dbus_error_init (&dbus_error); |
1537 | 139 | if (system_bus) { | 177 | if (use_dbus) { |
1538 | 140 | if (! dest_name) | 178 | if (! dest_name) |
1539 | 141 | dest_name = DBUS_SERVICE_UPSTART; | 179 | dest_name = DBUS_SERVICE_UPSTART; |
1540 | 142 | 180 | ||
1542 | 143 | connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error); | 181 | connection = dbus_bus_get (dbus_bus_type, &dbus_error); |
1543 | 144 | if (! connection) { | 182 | if (! connection) { |
1545 | 145 | nih_error ("%s: %s", _("Unable to connect to system bus"), | 183 | nih_error ("%s: %s", |
1546 | 184 | dbus_bus_type == DBUS_BUS_SYSTEM | ||
1547 | 185 | ? _("Unable to connect to system bus") | ||
1548 | 186 | : _("Unable to connect to session bus"), | ||
1549 | 146 | dbus_error.message); | 187 | dbus_error.message); |
1550 | 147 | dbus_error_free (&dbus_error); | 188 | dbus_error_free (&dbus_error); |
1551 | 148 | return NULL; | 189 | return NULL; |
1552 | @@ -1258,9 +1299,11 @@ | |||
1553 | 1258 | * Command-line options accepted for all arguments. | 1299 | * Command-line options accepted for all arguments. |
1554 | 1259 | **/ | 1300 | **/ |
1555 | 1260 | static NihOption options[] = { | 1301 | static NihOption options[] = { |
1556 | 1302 | { 0, "session", N_("use D-Bus session bus to connect to init daemon (for testing)"), | ||
1557 | 1303 | NULL, NULL, NULL, dbus_bus_type_setter }, | ||
1558 | 1261 | { 0, "system", N_("use D-Bus system bus to connect to init daemon"), | 1304 | { 0, "system", N_("use D-Bus system bus to connect to init daemon"), |
1561 | 1262 | NULL, NULL, &system_bus, NULL }, | 1305 | NULL, NULL, NULL, dbus_bus_type_setter }, |
1562 | 1263 | { 0, "dest", N_("destination well-known name on system bus"), | 1306 | { 0, "dest", N_("destination well-known name on D-Bus bus"), |
1563 | 1264 | NULL, "NAME", &dest_name, NULL }, | 1307 | NULL, "NAME", &dest_name, NULL }, |
1564 | 1265 | 1308 | ||
1565 | 1266 | NIH_OPTION_LAST | 1309 | NIH_OPTION_LAST |
1566 | 1267 | 1310 | ||
1567 | === modified file 'util/man/initctl.8' | |||
1568 | --- util/man/initctl.8 2010-02-04 19:08:07 +0000 | |||
1569 | +++ util/man/initctl.8 2011-06-03 09:21:18 +0000 | |||
1570 | @@ -1,4 +1,4 @@ | |||
1572 | 1 | .TH initctl 8 2010-02-04 "Upstart" | 1 | .TH initctl 8 2011-06-01 "Upstart" |
1573 | 2 | .\" | 2 | .\" |
1574 | 3 | .SH NAME | 3 | .SH NAME |
1575 | 4 | initctl \- init daemon control tool | 4 | initctl \- init daemon control tool |
1576 | @@ -33,6 +33,12 @@ | |||
1577 | 33 | .\" | 33 | .\" |
1578 | 34 | .SH OPTIONS | 34 | .SH OPTIONS |
1579 | 35 | .TP | 35 | .TP |
1580 | 36 | .B --session | ||
1581 | 37 | Connect to | ||
1582 | 38 | .BR init (8) | ||
1583 | 39 | daemon using the D-Bus session bus (for testing purposes only). | ||
1584 | 40 | .\" | ||
1585 | 41 | .TP | ||
1586 | 36 | .B --system | 42 | .B --system |
1587 | 37 | Communication with the | 43 | Communication with the |
1588 | 38 | .BR init (8) | 44 | .BR init (8) |
1589 | @@ -348,7 +354,7 @@ | |||
1590 | 348 | .RB < https://launchpad.net/upstart/+bugs > | 354 | .RB < https://launchpad.net/upstart/+bugs > |
1591 | 349 | .\" | 355 | .\" |
1592 | 350 | .SH COPYRIGHT | 356 | .SH COPYRIGHT |
1594 | 351 | Copyright \(co 2010 Canonical Ltd. | 357 | Copyright \(co 2010-2011 Canonical Ltd. |
1595 | 352 | .br | 358 | .br |
1596 | 353 | This is free software; see the source for copying conditions. There is NO | 359 | This is free software; see the source for copying conditions. There is NO |
1597 | 354 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 360 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
1598 | 355 | 361 | ||
1599 | === modified file 'util/reboot.c' | |||
1600 | --- util/reboot.c 2011-03-16 22:18:22 +0000 | |||
1601 | +++ util/reboot.c 2011-06-03 09:21:18 +0000 | |||
1602 | @@ -1,6 +1,5 @@ | |||
1603 | 1 | /* upstart | 1 | /* upstart |
1604 | 2 | * | 2 | * |
1605 | 3 | * Copyright © 2011 Google Inc. | ||
1606 | 4 | * Copyright © 2010 Canonical Ltd. | 3 | * Copyright © 2010 Canonical Ltd. |
1607 | 5 | * Author: Scott James Remnant <scott@netsplit.com>. | 4 | * Author: Scott James Remnant <scott@netsplit.com>. |
1608 | 6 | * | 5 | * |
1609 | 7 | 6 | ||
1610 | === modified file 'util/tests/test_initctl.c' | |||
1611 | --- util/tests/test_initctl.c 2010-02-04 20:43:33 +0000 | |||
1612 | +++ util/tests/test_initctl.c 2011-06-03 09:21:18 +0000 | |||
1613 | @@ -44,7 +44,8 @@ | |||
1614 | 44 | #include "dbus/upstart.h" | 44 | #include "dbus/upstart.h" |
1615 | 45 | 45 | ||
1616 | 46 | 46 | ||
1618 | 47 | extern int system_bus; | 47 | extern int use_dbus; |
1619 | 48 | extern int dbus_bus_type; | ||
1620 | 48 | extern char *dest_name; | 49 | extern char *dest_name; |
1621 | 49 | extern const char *dest_address; | 50 | extern const char *dest_address; |
1622 | 50 | extern int no_wait; | 51 | extern int no_wait; |
1623 | @@ -103,7 +104,7 @@ | |||
1624 | 103 | */ | 104 | */ |
1625 | 104 | TEST_FEATURE ("with private connection"); | 105 | TEST_FEATURE ("with private connection"); |
1626 | 105 | TEST_ALLOC_FAIL { | 106 | TEST_ALLOC_FAIL { |
1628 | 106 | system_bus = FALSE; | 107 | use_dbus = FALSE; |
1629 | 107 | dest_name = NULL; | 108 | dest_name = NULL; |
1630 | 108 | dest_address = "unix:abstract=/com/ubuntu/upstart/test"; | 109 | dest_address = "unix:abstract=/com/ubuntu/upstart/test"; |
1631 | 109 | 110 | ||
1632 | @@ -179,7 +180,8 @@ | |||
1633 | 179 | */ | 180 | */ |
1634 | 180 | TEST_FEATURE ("with system bus connection"); | 181 | TEST_FEATURE ("with system bus connection"); |
1635 | 181 | TEST_ALLOC_FAIL { | 182 | TEST_ALLOC_FAIL { |
1637 | 182 | system_bus = TRUE; | 183 | use_dbus = TRUE; |
1638 | 184 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1639 | 183 | dest_name = NULL; | 185 | dest_name = NULL; |
1640 | 184 | dest_address = DBUS_ADDRESS_UPSTART; | 186 | dest_address = DBUS_ADDRESS_UPSTART; |
1641 | 185 | 187 | ||
1642 | @@ -240,7 +242,8 @@ | |||
1643 | 240 | */ | 242 | */ |
1644 | 241 | TEST_FEATURE ("with system bus connection and different name"); | 243 | TEST_FEATURE ("with system bus connection and different name"); |
1645 | 242 | TEST_ALLOC_FAIL { | 244 | TEST_ALLOC_FAIL { |
1647 | 243 | system_bus = TRUE; | 245 | use_dbus = TRUE; |
1648 | 246 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1649 | 244 | dest_name = "com.ubuntu.UpstartTest"; | 247 | dest_name = "com.ubuntu.UpstartTest"; |
1650 | 245 | dest_address = DBUS_ADDRESS_UPSTART; | 248 | dest_address = DBUS_ADDRESS_UPSTART; |
1651 | 246 | 249 | ||
1652 | @@ -302,7 +305,7 @@ | |||
1653 | 302 | */ | 305 | */ |
1654 | 303 | TEST_FEATURE ("with non-listening private connection"); | 306 | TEST_FEATURE ("with non-listening private connection"); |
1655 | 304 | TEST_ALLOC_FAIL { | 307 | TEST_ALLOC_FAIL { |
1657 | 305 | system_bus = FALSE; | 308 | use_dbus = FALSE; |
1658 | 306 | dest_name = NULL; | 309 | dest_name = NULL; |
1659 | 307 | dest_address = "unix:abstract=/com/ubuntu/upstart/test"; | 310 | dest_address = "unix:abstract=/com/ubuntu/upstart/test"; |
1660 | 308 | 311 | ||
1661 | @@ -328,7 +331,8 @@ | |||
1662 | 328 | */ | 331 | */ |
1663 | 329 | TEST_FEATURE ("with non-listening system bus"); | 332 | TEST_FEATURE ("with non-listening system bus"); |
1664 | 330 | TEST_ALLOC_FAIL { | 333 | TEST_ALLOC_FAIL { |
1666 | 331 | system_bus = TRUE; | 334 | use_dbus = TRUE; |
1667 | 335 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1668 | 332 | dest_name = NULL; | 336 | dest_name = NULL; |
1669 | 333 | dest_address = DBUS_ADDRESS_UPSTART; | 337 | dest_address = DBUS_ADDRESS_UPSTART; |
1670 | 334 | 338 | ||
1671 | @@ -360,7 +364,7 @@ | |||
1672 | 360 | */ | 364 | */ |
1673 | 361 | TEST_FEATURE ("with --dest but without --system"); | 365 | TEST_FEATURE ("with --dest but without --system"); |
1674 | 362 | TEST_ALLOC_FAIL { | 366 | TEST_ALLOC_FAIL { |
1676 | 363 | system_bus = FALSE; | 367 | use_dbus = FALSE; |
1677 | 364 | dest_name = "com.ubuntu.Upstart"; | 368 | dest_name = "com.ubuntu.Upstart"; |
1678 | 365 | dest_address = DBUS_ADDRESS_UPSTART; | 369 | dest_address = DBUS_ADDRESS_UPSTART; |
1679 | 366 | 370 | ||
1680 | @@ -3229,7 +3233,8 @@ | |||
1681 | 3229 | "NameAcquired")); | 3233 | "NameAcquired")); |
1682 | 3230 | dbus_message_unref (method_call); | 3234 | dbus_message_unref (method_call); |
1683 | 3231 | 3235 | ||
1685 | 3232 | system_bus = TRUE; | 3236 | use_dbus = TRUE; |
1686 | 3237 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1687 | 3233 | dest_name = DBUS_SERVICE_UPSTART; | 3238 | dest_name = DBUS_SERVICE_UPSTART; |
1688 | 3234 | dest_address = DBUS_ADDRESS_UPSTART; | 3239 | dest_address = DBUS_ADDRESS_UPSTART; |
1689 | 3235 | 3240 | ||
1690 | @@ -4999,7 +5004,8 @@ | |||
1691 | 4999 | "NameAcquired")); | 5004 | "NameAcquired")); |
1692 | 5000 | dbus_message_unref (method_call); | 5005 | dbus_message_unref (method_call); |
1693 | 5001 | 5006 | ||
1695 | 5002 | system_bus = TRUE; | 5007 | use_dbus = TRUE; |
1696 | 5008 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1697 | 5003 | dest_name = DBUS_SERVICE_UPSTART; | 5009 | dest_name = DBUS_SERVICE_UPSTART; |
1698 | 5004 | dest_address = DBUS_ADDRESS_UPSTART; | 5010 | dest_address = DBUS_ADDRESS_UPSTART; |
1699 | 5005 | 5011 | ||
1700 | @@ -6584,7 +6590,8 @@ | |||
1701 | 6584 | "NameAcquired")); | 6590 | "NameAcquired")); |
1702 | 6585 | dbus_message_unref (method_call); | 6591 | dbus_message_unref (method_call); |
1703 | 6586 | 6592 | ||
1705 | 6587 | system_bus = TRUE; | 6593 | use_dbus = TRUE; |
1706 | 6594 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1707 | 6588 | dest_name = DBUS_SERVICE_UPSTART; | 6595 | dest_name = DBUS_SERVICE_UPSTART; |
1708 | 6589 | dest_address = DBUS_ADDRESS_UPSTART; | 6596 | dest_address = DBUS_ADDRESS_UPSTART; |
1709 | 6590 | 6597 | ||
1710 | @@ -8357,7 +8364,8 @@ | |||
1711 | 8357 | "NameAcquired")); | 8364 | "NameAcquired")); |
1712 | 8358 | dbus_message_unref (method_call); | 8365 | dbus_message_unref (method_call); |
1713 | 8359 | 8366 | ||
1715 | 8360 | system_bus = TRUE; | 8367 | use_dbus = TRUE; |
1716 | 8368 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1717 | 8361 | dest_name = DBUS_SERVICE_UPSTART; | 8369 | dest_name = DBUS_SERVICE_UPSTART; |
1718 | 8362 | dest_address = DBUS_ADDRESS_UPSTART; | 8370 | dest_address = DBUS_ADDRESS_UPSTART; |
1719 | 8363 | 8371 | ||
1720 | @@ -9239,7 +9247,8 @@ | |||
1721 | 9239 | "NameAcquired")); | 9247 | "NameAcquired")); |
1722 | 9240 | dbus_message_unref (method_call); | 9248 | dbus_message_unref (method_call); |
1723 | 9241 | 9249 | ||
1725 | 9242 | system_bus = TRUE; | 9250 | use_dbus = TRUE; |
1726 | 9251 | dbus_bus_type = DBUS_BUS_SYSTEM; | ||
1727 | 9243 | dest_name = DBUS_SERVICE_UPSTART; | 9252 | dest_name = DBUS_SERVICE_UPSTART; |
1728 | 9244 | dest_address = DBUS_ADDRESS_UPSTART; | 9253 | dest_address = DBUS_ADDRESS_UPSTART; |
1729 | 9245 | 9254 | ||
1730 | @@ -10769,7 +10778,7 @@ | |||
1731 | 10769 | "NameAcquired")); | 10778 | "NameAcquired")); |
1732 | 10770 | dbus_message_unref (method_call); | 10779 | dbus_message_unref (method_call); |
1733 | 10771 | 10780 | ||
1735 | 10772 | system_bus = TRUE; | 10781 | dbus_bus_type = DBUS_BUS_SYSTEM; |
1736 | 10773 | dest_name = DBUS_SERVICE_UPSTART; | 10782 | dest_name = DBUS_SERVICE_UPSTART; |
1737 | 10774 | dest_address = DBUS_ADDRESS_UPSTART; | 10783 | dest_address = DBUS_ADDRESS_UPSTART; |
1738 | 10775 | 10784 | ||
1739 | @@ -12060,7 +12069,7 @@ | |||
1740 | 12060 | "NameAcquired")); | 12069 | "NameAcquired")); |
1741 | 12061 | dbus_message_unref (method_call); | 12070 | dbus_message_unref (method_call); |
1742 | 12062 | 12071 | ||
1744 | 12063 | system_bus = TRUE; | 12072 | dbus_bus_type = DBUS_BUS_SYSTEM; |
1745 | 12064 | dest_name = DBUS_SERVICE_UPSTART; | 12073 | dest_name = DBUS_SERVICE_UPSTART; |
1746 | 12065 | dest_address = DBUS_ADDRESS_UPSTART; | 12074 | dest_address = DBUS_ADDRESS_UPSTART; |
1747 | 12066 | 12075 | ||
1748 | @@ -12494,7 +12503,7 @@ | |||
1749 | 12494 | "NameAcquired")); | 12503 | "NameAcquired")); |
1750 | 12495 | dbus_message_unref (method_call); | 12504 | dbus_message_unref (method_call); |
1751 | 12496 | 12505 | ||
1753 | 12497 | system_bus = TRUE; | 12506 | dbus_bus_type = DBUS_BUS_SYSTEM; |
1754 | 12498 | dest_name = DBUS_SERVICE_UPSTART; | 12507 | dest_name = DBUS_SERVICE_UPSTART; |
1755 | 12499 | dest_address = DBUS_ADDRESS_UPSTART; | 12508 | dest_address = DBUS_ADDRESS_UPSTART; |
1756 | 12500 | 12509 | ||
1757 | @@ -12684,7 +12693,7 @@ | |||
1758 | 12684 | "NameAcquired")); | 12693 | "NameAcquired")); |
1759 | 12685 | dbus_message_unref (method_call); | 12694 | dbus_message_unref (method_call); |
1760 | 12686 | 12695 | ||
1762 | 12687 | system_bus = TRUE; | 12696 | dbus_bus_type = DBUS_BUS_SYSTEM; |
1763 | 12688 | dest_name = DBUS_SERVICE_UPSTART; | 12697 | dest_name = DBUS_SERVICE_UPSTART; |
1764 | 12689 | dest_address = DBUS_ADDRESS_UPSTART; | 12698 | dest_address = DBUS_ADDRESS_UPSTART; |
1765 | 12690 | 12699 | ||
1766 | @@ -12904,7 +12913,7 @@ | |||
1767 | 12904 | "NameAcquired")); | 12913 | "NameAcquired")); |
1768 | 12905 | dbus_message_unref (method_call); | 12914 | dbus_message_unref (method_call); |
1769 | 12906 | 12915 | ||
1771 | 12907 | system_bus = TRUE; | 12916 | dbus_bus_type = DBUS_BUS_SYSTEM; |
1772 | 12908 | dest_name = DBUS_SERVICE_UPSTART; | 12917 | dest_name = DBUS_SERVICE_UPSTART; |
1773 | 12909 | dest_address = DBUS_ADDRESS_UPSTART; | 12918 | dest_address = DBUS_ADDRESS_UPSTART; |
1774 | 12910 | 12919 |