Merge lp:~jamesodhunt/upstart/upstream-configurable-confdir into lp:upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1286
Proposed branch: lp:~jamesodhunt/upstart/upstream-configurable-confdir
Merge into: lp:upstart
Diff against target: 1353 lines (+464/-254)
19 files modified
ChangeLog (+26/-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 (+198/-134)
init/man/init.8 (+11/-2)
init/paths.h (+16/-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 (+164/-96)
util/reboot.c (+0/-1)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/upstream-configurable-confdir
Reviewer Review Type Date Requested Status
Upstart Developers Pending
Review via email: mp+63344@code.launchpad.net

Description of the change

  Add option to allow alternate location for job config files.

  * init/main.c:
    - Added "--confdir <dir>" command-line option.
    - handle_confdir(): New function to select alternate confdir using env
      var "UPSTART_CONFDIR" or command-line option (for testing).
  * init/paths.h: Added define for CONFDIR_ENV.
  * init/man/init.8: Update for "--confdir".
  * Changelog: Updated.

To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

Note: This is a pre-requisite for the visualisation feature.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-05-12 20:42:28 +0000
+++ ChangeLog 2011-06-03 09:09:24 +0000
@@ -1,3 +1,29 @@
12011-05-31 James Hunt <james.hunt@ubuntu.com>
2
3 Add command-line option to use D-Bus session bus (for testing).
4
5 * init/control.c:
6 - Added new boolean use_session_bus.
7 - Updated comments.
8 - control_handle_bus_type(): New function to allow selection of
9 session bus via env var "UPSTART_USE_SESSION_BUS".
10 Also logs use of session bus if use_session_bus set.
11 - control_bus_open(): Now connects to either D-Bus system bus or session bus.
12 * init/control.h: New define for USE_SESSION_BUS_ENV.
13 * init/main.c: Addition of "--session" command-line option.
14 * init/man/init.8: Update for new "--session" command-line option.
15
16 * Corrected copyright notices.
17
18 Add option to allow alternate location for job config files.
19
20 * init/main.c:
21 - Added "--confdir <dir>" command-line option.
22 - handle_confdir(): New function to select alternate confdir using env
23 var "UPSTART_CONFDIR" or command-line option (for testing).
24 * init/paths.h: Added define for CONFDIR_ENV.
25 * init/man/init.8: Update for new "--confdir" command-line option.
26
12011-05-12 Marc - A. Dahlhaus <mad@wol.de>272011-05-12 Marc - A. Dahlhaus <mad@wol.de>
228
3 * init/job_class.h (JobClass): Add kill signal member29 * init/job_class.h (JobClass): Add kill signal member
430
=== modified file 'configure.ac'
--- configure.ac 2011-03-22 17:53:17 +0000
+++ configure.ac 2011-06-03 09:09:24 +0000
@@ -2,7 +2,7 @@
22
3AC_PREREQ(2.61)3AC_PREREQ(2.61)
4AC_INIT([upstart], [1.3], [upstart-devel@lists.ubuntu.com])4AC_INIT([upstart], [1.3], [upstart-devel@lists.ubuntu.com])
5NIH_COPYRIGHT([[Copyright © 2011 Scott James Remnant, Google Inc., Canonical Ltd.]])5NIH_COPYRIGHT([[Copyright © 2011 Scott James Remnant, Canonical Ltd.]])
6AC_CONFIG_SRCDIR([init/main.c])6AC_CONFIG_SRCDIR([init/main.c])
7AC_CONFIG_MACRO_DIR([m4])7AC_CONFIG_MACRO_DIR([m4])
88
99
=== modified file 'init/conf.c'
--- init/conf.c 2011-03-15 18:44:09 +0000
+++ init/conf.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * conf.c - configuration management3 * conf.c - configuration management
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2009 Canonical Ltd.5 * Copyright © 2009 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/control.c'
--- init/control.c 2009-07-11 11:47:12 +0000
+++ init/control.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * control.c - D-Bus connections, objects and methods3 * control.c - D-Bus connections, objects and methods
4 *4 *
5 * Copyright © 2009 Canonical Ltd.5 * Copyright © 2009-2011 Canonical Ltd.
6 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
7 *7 *
8 * This program is free software; you can redistribute it and/or modify8 * This program is free software; you can redistribute it and/or modify
@@ -54,12 +54,19 @@
5454
55#include "com.ubuntu.Upstart.h"55#include "com.ubuntu.Upstart.h"
5656
57
58/* Prototypes for static functions */57/* Prototypes for static functions */
59static int control_server_connect (DBusServer *server, DBusConnection *conn);58static int control_server_connect (DBusServer *server, DBusConnection *conn);
60static void control_disconnected (DBusConnection *conn);59static void control_disconnected (DBusConnection *conn);
61static void control_register_all (DBusConnection *conn);60static void control_register_all (DBusConnection *conn);
6261
62/**
63 * use_session_bus:
64 *
65 * If TRUE, connect to the D-Bus sessio bus rather than the system bus.
66 *
67 * Used for testing.
68 **/
69int use_session_bus = FALSE;
6370
64/**71/**
65 * control_server_address:72 * control_server_address:
@@ -78,7 +85,7 @@
78/**85/**
79 * control_bus:86 * control_bus:
80 *87 *
81 * Open connection to D-Bus system bus. The connection may be opened with88 * Open connection to a D-Bus bus. The connection may be opened with
82 * control_bus_open() and if lost will become NULL.89 * control_bus_open() and if lost will become NULL.
83 **/90 **/
84DBusConnection *control_bus = NULL;91DBusConnection *control_bus = NULL;
@@ -86,7 +93,7 @@
86/**93/**
87 * control_conns:94 * control_conns:
88 *95 *
89 * Open control connections, including the connection to the D-Bus system96 * Open control connections, including the connection to a D-Bus
90 * bus and any private client connections.97 * bus and any private client connections.
91 **/98 **/
92NihList *control_conns = NULL;99NihList *control_conns = NULL;
@@ -190,8 +197,9 @@
190/**197/**
191 * control_bus_open:198 * control_bus_open:
192 *199 *
193 * Open a connection to the D-Bus system bus and store it in the control_bus200 * Open a connection to the appropriate D-Bus bus and store it in the
194 * global. The connection is handled automatically in the main loop.201 * control_bus global. The connection is handled automatically
202 * in the main loop.
195 *203 *
196 * Returns: zero on success, negative value on raised error.204 * Returns: zero on success, negative value on raised error.
197 **/205 **/
@@ -207,10 +215,13 @@
207215
208 control_init ();216 control_init ();
209217
218 control_handle_bus_type ();
219
210 /* Connect to the D-Bus System Bus and hook everything up into220 /* Connect to the D-Bus System Bus and hook everything up into
211 * our own main loop automatically.221 * our own main loop automatically.
212 */222 */
213 conn = nih_dbus_bus (DBUS_BUS_SYSTEM, control_disconnected);223 conn = nih_dbus_bus (use_session_bus ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM,
224 control_disconnected);
214 if (! conn)225 if (! conn)
215 return -1;226 return -1;
216227
@@ -669,3 +680,18 @@
669680
670 return 0;681 return 0;
671}682}
683
684/**
685 * control_handle_bus_type:
686 *
687 * Determine D-Bus bus type to connect to.
688 **/
689void
690control_handle_bus_type (void)
691{
692 if (getenv (USE_SESSION_BUS_ENV))
693 use_session_bus = TRUE;
694
695 if (use_session_bus)
696 nih_debug ("Using session bus");
697}
672698
=== modified file 'init/control.h'
--- init/control.h 2009-07-09 08:36:52 +0000
+++ init/control.h 2011-06-03 09:09:24 +0000
@@ -1,6 +1,6 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2009 Canonical Ltd.3 * Copyright © 2009-2011 Canonical Ltd.
4 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
@@ -27,6 +27,18 @@
27#include <nih-dbus/dbus_connection.h>27#include <nih-dbus/dbus_connection.h>
28#include <nih-dbus/dbus_message.h>28#include <nih-dbus/dbus_message.h>
2929
30/**
31 * USE_SESSION_BUS_ENV:
32 *
33 * If this environment variable is set to any value, connect to
34 * D-Bus session bus rather than the system bus.
35 *
36 * Used for testing.
37 **/
38#ifndef USE_SESSION_BUS_ENV
39#define USE_SESSION_BUS_ENV "UPSTART_USE_SESSION_BUS"
40#endif
41
3042
31NIH_BEGIN_EXTERN43NIH_BEGIN_EXTERN
3244
@@ -72,6 +84,8 @@
72 const char *log_priority)84 const char *log_priority)
73 __attribute__ ((warn_unused_result));85 __attribute__ ((warn_unused_result));
7486
87void control_handle_bus_type (void);
88
75NIH_END_EXTERN89NIH_END_EXTERN
7690
77#endif /* INIT_CONTROL_H */91#endif /* INIT_CONTROL_H */
7892
=== modified file 'init/environ.c'
--- init/environ.c 2011-03-16 22:42:48 +0000
+++ init/environ.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * environ.c - environment table utilities3 * environ.c - environment table utilities
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2009 Canonical Ltd.5 * Copyright © 2009 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/environ.h'
--- init/environ.h 2011-03-16 22:42:48 +0000
+++ init/environ.h 2011-06-03 09:09:24 +0000
@@ -1,6 +1,5 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2011 Google Inc.
4 * Copyright © 2009 Canonical Ltd.3 * Copyright © 2009 Canonical Ltd.
5 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
6 *5 *
76
=== modified file 'init/job_process.c'
--- init/job_process.c 2011-05-12 20:42:28 +0000
+++ init/job_process.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * job_process.c - job process handling3 * job_process.c - job process handling
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2011 Canonical Ltd.5 * Copyright © 2011 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/job_process.h'
--- init/job_process.h 2011-05-12 19:21:16 +0000
+++ init/job_process.h 2011-06-03 09:09:24 +0000
@@ -1,6 +1,5 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2011 Google Inc.
4 * Copyright © 2009 Canonical Ltd.3 * Copyright © 2009 Canonical Ltd.
5 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
6 *5 *
76
=== modified file 'init/main.c'
--- init/main.c 2011-03-16 22:54:56 +0000
+++ init/main.c 2011-06-03 09:09:24 +0000
@@ -1,7 +1,6 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2011 Google Inc.3 * Copyright © 2009-2011 Canonical Ltd.
4 * Copyright © 2010 Canonical Ltd.
5 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
6 *5 *
7 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
@@ -71,6 +70,8 @@
71static void usr1_handler (void *data, NihSignal *signal);70static void usr1_handler (void *data, NihSignal *signal);
72#endif /* DEBUG */71#endif /* DEBUG */
7372
73static void handle_confdir (void);
74
7475
75/**76/**
76 * argv0:77 * argv0:
@@ -90,13 +91,29 @@
9091
9192
92/**93/**
94 * conf_dir:
95 *
96 * Full path to job configuration file directory.
97 *
98 **/
99static char *conf_dir = NULL;
100
101extern int use_session_bus;
102
103/**
93 * options:104 * options:
94 *105 *
95 * Command-line options we accept.106 * Command-line options we accept.
96 **/107 **/
97static NihOption options[] = {108static NihOption options[] = {
109 { 0, "confdir", N_("specify alternative directory to load configuration files from"),
110 NULL, "DIR", &conf_dir, NULL },
111
98 { 0, "restart", NULL, NULL, NULL, &restart, NULL },112 { 0, "restart", NULL, NULL, NULL, &restart, NULL },
99113
114 { 0, "session", N_("use D-Bus session bus rather than system bus (for testing)"),
115 NULL, NULL, &use_session_bus, NULL },
116
100 /* Ignore invalid options */117 /* Ignore invalid options */
101 { '-', "--", NULL, NULL, NULL, NULL, NULL },118 { '-', "--", NULL, NULL, NULL, NULL, NULL },
102119
@@ -124,94 +141,105 @@
124 if (! args)141 if (! args)
125 exit (1);142 exit (1);
126143
144 handle_confdir ();
145 control_handle_bus_type ();
146
127#ifndef DEBUG147#ifndef DEBUG
128 /* Check we're root */148 if (use_session_bus == FALSE) {
129 if (getuid ()) {149
130 nih_fatal (_("Need to be root"));150 /* Check we're root */
131 exit (1);151 if (getuid ()) {
132 }152 nih_fatal (_("Need to be root"));
133153 exit (1);
134 /* Check we're process #1 */154 }
135 if (getpid () > 1) {155
136 execv (TELINIT, argv);156 /* Check we're process #1 */
137 /* Ignore failure, probably just that telinit doesn't exist */157 if (getpid () > 1) {
138158 execv (TELINIT, argv);
139 nih_fatal (_("Not being executed as init"));159 /* Ignore failure, probably just that telinit doesn't exist */
140 exit (1);160
141 }161 nih_fatal (_("Not being executed as init"));
142162 exit (1);
143 /* Clear our arguments from the command-line, so that we show up in163 }
144 * ps or top output as /sbin/init, with no extra flags.164
145 *165 /* Clear our arguments from the command-line, so that we show up in
146 * This is a very Linux-specific trick; by deleting the NULL166 * ps or top output as /sbin/init, with no extra flags.
147 * terminator at the end of the last argument, we fool the kernel167 *
148 * into believing we used a setproctitle()-a-like to extend the168 * This is a very Linux-specific trick; by deleting the NULL
149 * argument space into the environment space, and thus make it use169 * terminator at the end of the last argument, we fool the kernel
150 * strlen() instead of its own assumed length. In fact, we've done170 * into believing we used a setproctitle()-a-like to extend the
151 * the exact opposite, and shrunk the command line length to just that171 * argument space into the environment space, and thus make it use
152 * of whatever is in argv[0].172 * strlen() instead of its own assumed length. In fact, we've done
153 *173 * the exact opposite, and shrunk the command line length to just that
154 * If we don't do this, and just write \0 over the rest of argv, for174 * of whatever is in argv[0].
155 * example; the command-line length still includes those \0s, and ps175 *
156 * will show whitespace in their place.176 * If we don't do this, and just write \0 over the rest of argv, for
157 */177 * example; the command-line length still includes those \0s, and ps
158 if (argc > 1) {178 * will show whitespace in their place.
159 char *arg_end;179 */
160180 if (argc > 1) {
161 arg_end = argv[argc-1] + strlen (argv[argc-1]);181 char *arg_end;
162 *arg_end = ' ';182
163 }183 arg_end = argv[argc-1] + strlen (argv[argc-1]);
164184 *arg_end = ' ';
165185 }
166 /* Become the leader of a new session and process group, shedding186
167 * any controlling tty (which we shouldn't have had anyway - but187
168 * you never know what initramfs did).188 /* Become the leader of a new session and process group, shedding
169 */189 * any controlling tty (which we shouldn't have had anyway - but
170 setsid ();190 * you never know what initramfs did).
171191 */
172 /* Set the standard file descriptors to the ordinary console device,192 setsid ();
173 * resetting it to sane defaults unless we're inheriting from another193
174 * init process which we know left it in a sane state.194 /* Set the standard file descriptors to the ordinary console device,
175 */195 * resetting it to sane defaults unless we're inheriting from another
176 if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0)196 * init process which we know left it in a sane state.
177 nih_free (nih_error_get ());197 */
178198 if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0)
179 /* Set the PATH environment variable */199 nih_free (nih_error_get ());
180 setenv ("PATH", PATH, TRUE);200
181201 /* Set the PATH environment variable */
182 /* Switch to the root directory in case we were started from some202 setenv ("PATH", PATH, TRUE);
183 * strange place, or worse, some directory in the initramfs that's203
184 * going to go away soon.204 /* Switch to the root directory in case we were started from some
185 */205 * strange place, or worse, some directory in the initramfs that's
186 if (chdir ("/"))206 * going to go away soon.
187 nih_warn ("%s: %s", _("Unable to set root directory"),207 */
188 strerror (errno));208 if (chdir ("/"))
189209 nih_warn ("%s: %s", _("Unable to set root directory"),
190 /* Mount the /proc and /sys filesystems, which are pretty much210 strerror (errno));
191 * essential for any Linux system; not to mention used by211
192 * ourselves.212 /* Mount the /proc and /sys filesystems, which are pretty much
193 */213 * essential for any Linux system; not to mention used by
194 if (system_mount ("proc", "/proc") < 0) {214 * ourselves.
195 NihError *err;215 */
196216 if (system_mount ("proc", "/proc") < 0) {
197 err = nih_error_get ();217 NihError *err;
198 nih_warn ("%s: %s", _("Unable to mount /proc filesystem"),218
199 err->message);219 err = nih_error_get ();
200 nih_free (err);220 nih_warn ("%s: %s", _("Unable to mount /proc filesystem"),
201 }221 err->message);
202222 nih_free (err);
203 if (system_mount ("sysfs", "/sys") < 0) {223 }
204 NihError *err;224
205225 if (system_mount ("sysfs", "/sys") < 0) {
206 err = nih_error_get ();226 NihError *err;
207 nih_warn ("%s: %s", _("Unable to mount /sys filesystem"),227
208 err->message);228 err = nih_error_get ();
209 nih_free (err);229 nih_warn ("%s: %s", _("Unable to mount /sys filesystem"),
210 }230 err->message);
231 nih_free (err);
232 }
233 } else {
234 nih_log_set_priority (NIH_LOG_DEBUG);
235 nih_debug ("Running with UID %d as PID %d (PPID %d)",
236 (int)getuid (), (int)getpid (), (int)getppid ());
237 }
238
211#else /* DEBUG */239#else /* DEBUG */
212 nih_log_set_priority (NIH_LOG_DEBUG);240 nih_log_set_priority (NIH_LOG_DEBUG);
213 nih_debug ("Running as PID %d (PPID %d)",241 nih_debug ("Running with UID %d as PID %d (PPID %d)",
214 (int)getpid (), (int)getppid ());242 (int)getuid (), (int)getpid (), (int)getppid ());
215#endif /* DEBUG */243#endif /* DEBUG */
216244
217245
@@ -223,11 +251,13 @@
223 nih_signal_reset ();251 nih_signal_reset ();
224252
225#ifndef DEBUG253#ifndef DEBUG
226 /* Catch fatal errors immediately rather than waiting for a new254 if (use_session_bus == FALSE) {
227 * iteration through the main loop.255 /* Catch fatal errors immediately rather than waiting for a new
228 */256 * iteration through the main loop.
229 nih_signal_set_handler (SIGSEGV, crash_handler);257 */
230 nih_signal_set_handler (SIGABRT, crash_handler);258 nih_signal_set_handler (SIGSEGV, crash_handler);
259 nih_signal_set_handler (SIGABRT, crash_handler);
260 }
231#endif /* DEBUG */261#endif /* DEBUG */
232262
233 /* Don't ignore SIGCHLD or SIGALRM, but don't respond to them263 /* Don't ignore SIGCHLD or SIGALRM, but don't respond to them
@@ -238,33 +268,35 @@
238 nih_signal_set_handler (SIGALRM, nih_signal_handler);268 nih_signal_set_handler (SIGALRM, nih_signal_handler);
239269
240#ifndef DEBUG270#ifndef DEBUG
241 /* Ask the kernel to send us SIGINT when control-alt-delete is271 if (use_session_bus == FALSE) {
242 * pressed; generate an event with the same name.272 /* Ask the kernel to send us SIGINT when control-alt-delete is
243 */273 * pressed; generate an event with the same name.
244 reboot (RB_DISABLE_CAD);274 */
245 nih_signal_set_handler (SIGINT, nih_signal_handler);275 reboot (RB_DISABLE_CAD);
246 NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cad_handler, NULL));276 nih_signal_set_handler (SIGINT, nih_signal_handler);
247277 NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cad_handler, NULL));
248 /* Ask the kernel to send us SIGWINCH when alt-uparrow is pressed;278
249 * generate a keyboard-request event.279 /* Ask the kernel to send us SIGWINCH when alt-uparrow is pressed;
250 */280 * generate a keyboard-request event.
251 if (ioctl (0, KDSIGACCEPT, SIGWINCH) == 0) {281 */
252 nih_signal_set_handler (SIGWINCH, nih_signal_handler);282 if (ioctl (0, KDSIGACCEPT, SIGWINCH) == 0) {
253 NIH_MUST (nih_signal_add_handler (NULL, SIGWINCH,283 nih_signal_set_handler (SIGWINCH, nih_signal_handler);
254 kbd_handler, NULL));284 NIH_MUST (nih_signal_add_handler (NULL, SIGWINCH,
285 kbd_handler, NULL));
286 }
287
288 /* powstatd sends us SIGPWR when it changes /etc/powerstatus */
289 nih_signal_set_handler (SIGPWR, nih_signal_handler);
290 NIH_MUST (nih_signal_add_handler (NULL, SIGPWR, pwr_handler, NULL));
291
292 /* SIGHUP instructs us to re-load our configuration */
293 nih_signal_set_handler (SIGHUP, nih_signal_handler);
294 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL));
295
296 /* SIGUSR1 instructs us to reconnect to D-Bus */
297 nih_signal_set_handler (SIGUSR1, nih_signal_handler);
298 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL));
255 }299 }
256
257 /* powstatd sends us SIGPWR when it changes /etc/powerstatus */
258 nih_signal_set_handler (SIGPWR, nih_signal_handler);
259 NIH_MUST (nih_signal_add_handler (NULL, SIGPWR, pwr_handler, NULL));
260
261 /* SIGHUP instructs us to re-load our configuration */
262 nih_signal_set_handler (SIGHUP, nih_signal_handler);
263 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL));
264
265 /* SIGUSR1 instructs us to reconnect to D-Bus */
266 nih_signal_set_handler (SIGUSR1, nih_signal_handler);
267 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL));
268#endif /* DEBUG */300#endif /* DEBUG */
269301
270302
@@ -279,25 +311,27 @@
279311
280 /* Read configuration */312 /* Read configuration */
281 NIH_MUST (conf_source_new (NULL, CONFFILE, CONF_FILE));313 NIH_MUST (conf_source_new (NULL, CONFFILE, CONF_FILE));
282 NIH_MUST (conf_source_new (NULL, CONFDIR, CONF_JOB_DIR));314 NIH_MUST (conf_source_new (NULL, conf_dir, CONF_JOB_DIR));
283315
284 conf_reload ();316 conf_reload ();
285317
286 /* Create a listening server for private connections. */318 /* Create a listening server for private connections. */
287 while (control_server_open () < 0) {319 if (use_session_bus == FALSE) {
288 NihError *err;320 while (control_server_open () < 0) {
321 NihError *err;
289322
290 err = nih_error_get ();323 err = nih_error_get ();
291 if (err->number != ENOMEM) {324 if (err->number != ENOMEM) {
292 nih_warn ("%s: %s", _("Unable to listen for private connections"),325 nih_warn ("%s: %s", _("Unable to listen for private connections"),
293 err->message);326 err->message);
327 nih_free (err);
328 break;
329 }
294 nih_free (err);330 nih_free (err);
295 break;
296 }331 }
297 nih_free (err);
298 }332 }
299333
300 /* Open connection to the system bus; we normally expect this to334 /* Open connection to the appropriate D-Bus bus; we normally expect this to
301 * fail and will try again later - don't let ENOMEM stop us though.335 * fail and will try again later - don't let ENOMEM stop us though.
302 */336 */
303 while (control_bus_open () < 0) {337 while (control_bus_open () < 0) {
@@ -313,13 +347,15 @@
313 }347 }
314348
315#ifndef DEBUG349#ifndef DEBUG
316 /* Now that the startup is complete, send all further logging output350 if (use_session_bus == FALSE) {
317 * to kmsg instead of to the console.351 /* Now that the startup is complete, send all further logging output
318 */352 * to kmsg instead of to the console.
319 if (system_setup_console (CONSOLE_NONE, FALSE) < 0)353 */
320 nih_free (nih_error_get ());354 if (system_setup_console (CONSOLE_NONE, FALSE) < 0)
355 nih_free (nih_error_get ());
321356
322 nih_log_set_logger (logger_kmsg);357 nih_log_set_logger (logger_kmsg);
358 }
323#endif /* DEBUG */359#endif /* DEBUG */
324360
325361
@@ -573,3 +609,31 @@
573 }609 }
574}610}
575#endif /* DEBUG */611#endif /* DEBUG */
612
613/**
614 * handle_confdir:
615 *
616 * Determine where system configuration files should be loaded from.
617 **/
618static void
619handle_confdir (void)
620{
621 char *dir;
622
623 /* user has already specified directory on command-line */
624 if (conf_dir)
625 goto out;
626
627 conf_dir = CONFDIR;
628
629 dir = getenv (CONFDIR_ENV);
630 if (! dir)
631 return;
632
633 conf_dir = dir;
634
635out:
636 nih_debug ("Using alternate configuration directory %s",
637 conf_dir);
638}
639
576640
=== modified file 'init/man/init.8'
--- init/man/init.8 2010-02-04 19:26:17 +0000
+++ init/man/init.8 2011-06-03 09:09:24 +0000
@@ -1,4 +1,4 @@
1.TH init 8 2010-02-04 "Upstart"1.TH init 8 2011-05-31 "Upstart"
2.\"2.\"
3.SH NAME3.SH NAME
4init \- Upstart process management daemon4init \- Upstart process management daemon
@@ -64,6 +64,15 @@
64by placing them on the kernel command-line.64by placing them on the kernel command-line.
65.\"65.\"
66.TP66.TP
67.B \-\-confdir \fIdirectory\fP
68Read job configuration files from a directory other than
69\fI/etc/init\fP.
70.\"
71.TP
72.B \-\-session
73Connect to the D\-Bus session bus. This should only be used for testing.
74.\"
75.TP
67.B --verbose76.B --verbose
68Outputs verbose messages about job state changes and event emissions to the77Outputs verbose messages about job state changes and event emissions to the
69system console or log, useful for debugging boot.78system console or log, useful for debugging boot.
@@ -90,7 +99,7 @@
90.RB < https://launchpad.net/upstart/+bugs >99.RB < https://launchpad.net/upstart/+bugs >
91.\"100.\"
92.SH COPYRIGHT101.SH COPYRIGHT
93Copyright \(co 2010 Canonical Ltd.102Copyright \(co 2009-2011 Canonical Ltd.
94.br103.br
95This is free software; see the source for copying conditions. There is NO104This is free software; see the source for copying conditions. There is NO
96warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.105warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
97106
=== modified file 'init/paths.h'
--- init/paths.h 2010-02-26 15:27:14 +0000
+++ init/paths.h 2011-06-03 09:09:24 +0000
@@ -1,6 +1,6 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2010 Canonical Ltd.3 * Copyright © 2010-2011 Canonical Ltd.
4 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,7 @@
67/**67/**
68 * CONFDIR:68 * CONFDIR:
69 *69 *
70 * Top-level directory of the system configuration files.70 * Default top-level directory of the system configuration files.
71 **/71 **/
72#ifndef CONFDIR72#ifndef CONFDIR
73#define CONFDIR "/etc/init"73#define CONFDIR "/etc/init"
@@ -75,6 +75,20 @@
7575
7676
77/**77/**
78 * CONFDIR_ENV:
79 *
80 * If this environment variable is set, read configuration files
81 * from the location specified, rather than CONFDIR.
82 *
83 * Value is expected to be the full path to an alternative job
84 * configuration directory.
85 **/
86#ifndef CONFDIR_ENV
87#define CONFDIR_ENV "UPSTART_CONFDIR"
88#endif
89
90
91/**
78 * SHELL:92 * SHELL:
79 *93 *
80 * This is the shell binary used whenever we need special processing for94 * This is the shell binary used whenever we need special processing for
8195
=== modified file 'init/tests/test_conf.c'
--- init/tests/test_conf.c 2011-02-17 23:38:17 +0000
+++ init/tests/test_conf.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * test_conf.c - test suite for init/conf.c3 * test_conf.c - test suite for init/conf.c
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2009 Canonical Ltd.5 * Copyright © 2009 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/tests/test_control.c'
--- init/tests/test_control.c 2011-03-16 22:42:48 +0000
+++ init/tests/test_control.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * test_dbus.c - test suite for init/dbus.c3 * test_dbus.c - test suite for init/dbus.c
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2010 Canonical Ltd.5 * Copyright © 2010 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/tests/test_environ.c'
--- init/tests/test_environ.c 2011-03-16 22:42:48 +0000
+++ init/tests/test_environ.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * test_environ.c - test suite for init/environ.c3 * test_environ.c - test suite for init/environ.c
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2009 Canonical Ltd.5 * Copyright © 2009 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/tests/test_job_class.c'
--- init/tests/test_job_class.c 2011-05-12 20:42:28 +0000
+++ init/tests/test_job_class.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * test_job_class.c - test suite for init/job_class.c3 * test_job_class.c - test suite for init/job_class.c
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2010 Canonical Ltd.5 * Copyright © 2010 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'init/tests/test_job_process.c'
--- init/tests/test_job_process.c 2011-05-12 19:21:16 +0000
+++ init/tests/test_job_process.c 2011-06-03 09:09:24 +0000
@@ -2,7 +2,6 @@
2 *2 *
3 * test_job_process.c - test suite for init/job_process.c3 * test_job_process.c - test suite for init/job_process.c
4 *4 *
5 * Copyright © 2011 Google Inc.
6 * Copyright © 2011 Canonical Ltd.5 * Copyright © 2011 Canonical Ltd.
7 * Author: Scott James Remnant <scott@netsplit.com>.6 * Author: Scott James Remnant <scott@netsplit.com>.
8 *7 *
98
=== modified file 'po/upstart.pot'
--- po/upstart.pot 2011-03-22 17:52:25 +0000
+++ po/upstart.pot 2011-06-03 09:09:24 +0000
@@ -6,76 +6,141 @@
6#, fuzzy6#, fuzzy
7msgid ""7msgid ""
8msgstr ""8msgstr ""
9"Project-Id-Version: upstart 1.2\n"9"Project-Id-Version: upstart 1.3\n"
10"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"10"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
11"POT-Creation-Date: 2011-03-22 10:52-0700\n"11"POT-Creation-Date: 2011-05-31 16:18+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
15"MIME-Version: 1.0\n"16"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
17"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1819
19#: init/conf.c:23820#: init/conf.c:237
20msgid "Unable to load configuration"21msgid "Unable to load configuration"
21msgstr ""22msgstr ""
2223
23#: init/conf.c:27124#: init/conf.c:270
24#, c-format25#, c-format
25msgid "Loading configuration from %s"26msgid "Loading configuration from %s"
26msgstr ""27msgstr ""
2728
28#: init/conf.c:30829#: init/conf.c:307
29#, c-format30#, c-format
30msgid "Handling deletion of %s"31msgid "Handling deletion of %s"
31msgstr ""32msgstr ""
3233
33#: init/conf.c:37934#: init/conf.c:378
34msgid "Unable to watch configuration file"35msgid "Unable to watch configuration file"
35msgstr ""36msgstr ""
3637
37#: init/conf.c:45738#: init/conf.c:456
38msgid "Unable to watch configuration directory"39msgid "Unable to watch configuration directory"
39msgstr ""40msgstr ""
4041
41#: init/conf.c:569 init/conf.c:65342#: init/conf.c:568 init/conf.c:652
42msgid "Error while loading configuration file"43msgid "Error while loading configuration file"
43msgstr ""44msgstr ""
4445
45#: init/conf.c:60946#: init/conf.c:608
46msgid "Configuration directory deleted"47msgid "Configuration directory deleted"
47msgstr ""48msgstr ""
4849
49#: init/control.c:15550#: init/control.c:162
50msgid "Connection from private client"51msgid "Connection from private client"
51msgstr ""52msgstr ""
5253
53#: init/control.c:29054#: init/control.c:301
54msgid "Disconnected from system bus"55msgid "Disconnected from system bus"
55msgstr ""56msgstr ""
5657
57#: init/control.c:356 init/main.c:54658#: init/control.c:367 init/main.c:582
58msgid "Reloading configuration"59msgid "Reloading configuration"
59msgstr ""60msgstr ""
6061
61#: init/control.c:396 init/control.c:50762#: init/control.c:407 init/control.c:518
62msgid "Name may not be empty string"63msgid "Name may not be empty string"
63msgstr ""64msgstr ""
6465
65#: init/control.c:40566#: init/control.c:416
66#, c-format67#, c-format
67msgid "Unknown job: %s"68msgid "Unknown job: %s"
68msgstr ""69msgstr ""
6970
70#: init/control.c:514 init/job_class.c:522 init/job_class.c:71071#: init/control.c:525 init/job_class.c:524 init/job_class.c:712
71#: init/job_class.c:829 init/job_class.c:95372#: init/job_class.c:831 init/job_class.c:955
72msgid "Env must be KEY=VALUE pairs"73msgid "Env must be KEY=VALUE pairs"
73msgstr ""74msgstr ""
7475
75#: init/control.c:66676#: init/control.c:677
76msgid "The log priority given was not recognised"77msgid "The log priority given was not recognised"
77msgstr ""78msgstr ""
7879
80#: init/errors.h:58
81msgid "Illegal parameter"
82msgstr ""
83
84#: init/errors.h:59
85msgid "Unknown parameter"
86msgstr ""
87
88#: init/errors.h:60 init/errors.h:71
89msgid "Expected operator"
90msgstr ""
91
92#: init/errors.h:61
93msgid "Mismatched braces"
94msgstr ""
95
96#: init/errors.h:62
97msgid "Illegal interval, expected number of seconds"
98msgstr ""
99
100#: init/errors.h:63
101msgid "Illegal exit status, expected integer"
102msgstr ""
103
104#: init/errors.h:64
105msgid "Illegal signal status, expected integer"
106msgstr ""
107
108#: init/errors.h:65
109msgid "Illegal file creation mask, expected octal integer"
110msgstr ""
111
112#: init/errors.h:66
113msgid "Illegal nice value, expected -20 to 19"
114msgstr ""
115
116#: init/errors.h:67
117msgid "Illegal oom adjustment, expected -16 to 15 or 'never'"
118msgstr ""
119
120#: init/errors.h:68
121msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'"
122msgstr ""
123
124#: init/errors.h:69
125msgid "Illegal limit, expected 'unlimited' or integer"
126msgstr ""
127
128#: init/errors.h:70
129msgid "Expected event"
130msgstr ""
131
132#: init/errors.h:72
133msgid "Expected variable name before value"
134msgstr ""
135
136#: init/errors.h:73
137msgid "Mismatched parentheses"
138msgstr ""
139
140#: init/errors.h:74
141msgid "Name already taken"
142msgstr ""
143
79#: init/event.c:273144#: init/event.c:273
80#, c-format145#, c-format
81msgid "Handling %s event"146msgid "Handling %s event"
@@ -164,241 +229,244 @@
164msgid "post-stop"229msgid "post-stop"
165msgstr ""230msgstr ""
166231
167#: init/job.c:1113 init/job_class.c:756232#: init/job.c:1113 init/job_class.c:758
168#, c-format233#, c-format
169msgid "Job is already running: %s"234msgid "Job is already running: %s"
170msgstr ""235msgstr ""
171236
172#: init/job.c:1177 init/job.c:1242 init/job_class.c:875 init/job_class.c:998237#: init/job.c:1177 init/job.c:1242 init/job_class.c:877 init/job_class.c:1000
173#, c-format238#, c-format
174msgid "Job has already been stopped: %s"239msgid "Job has already been stopped: %s"
175msgstr ""240msgstr ""
176241
177#: init/job_class.c:559 init/job_class.c:604 init/job_class.c:867242#: init/job_class.c:561 init/job_class.c:606 init/job_class.c:869
178#: init/job_class.c:990243#: init/job_class.c:992
179#, c-format244#, c-format
180msgid "Unknown instance: %s"245msgid "Unknown instance: %s"
181msgstr ""246msgstr ""
182247
183#: init/job_process.c:279248#: init/job_process.c:276
184#, c-format249#, c-format
185msgid "Failed to spawn %s %s process: %s"250msgid "Failed to spawn %s %s process: %s"
186msgstr ""251msgstr ""
187252
188#: init/job_process.c:285253#: init/job_process.c:282
189msgid "Temporary process spawn error"254msgid "Temporary process spawn error"
190msgstr ""255msgstr ""
191256
192#: init/job_process.c:292257#: init/job_process.c:289
193#, c-format258#, c-format
194msgid "%s %s process (%d)"259msgid "%s %s process (%d)"
195msgstr ""260msgstr ""
196261
197#: init/job_process.c:399262#: init/job_process.c:402
198#, c-format263#, c-format
199msgid "Pausing %s (%d) [pre-exec] for debug"264msgid "Pausing %s (%d) [pre-exec] for debug"
200msgstr ""265msgstr ""
201266
202#: init/job_process.c:453267#: init/job_process.c:472
203#, c-format268#, c-format
204msgid "Failed to open system console: %s"269msgid "Failed to open system console: %s"
205msgstr ""270msgstr ""
206271
207#: init/job_process.c:669272#: init/job_process.c:696
273#, c-format
274msgid "unable to move script fd: %s"
275msgstr ""
276
277#: init/job_process.c:701
208#, c-format278#, c-format
209msgid "unable to open console: %s"279msgid "unable to open console: %s"
210msgstr ""280msgstr ""
211281
212#: init/job_process.c:724282#: init/job_process.c:756
213#, c-format283#, c-format
214msgid "unable to set \"%s\" resource limit: %s"284msgid "unable to set \"%s\" resource limit: %s"
215msgstr ""285msgstr ""
216286
217#: init/job_process.c:729287#: init/job_process.c:761
218#, c-format288#, c-format
219msgid "unable to set priority: %s"289msgid "unable to set priority: %s"
220msgstr ""290msgstr ""
221291
222#: init/job_process.c:734292#: init/job_process.c:766
223#, c-format293#, c-format
224msgid "unable to set oom adjustment: %s"294msgid "unable to set oom adjustment: %s"
225msgstr ""295msgstr ""
226296
227#: init/job_process.c:739297#: init/job_process.c:771
228#, c-format298#, c-format
229msgid "unable to change root directory: %s"299msgid "unable to change root directory: %s"
230msgstr ""300msgstr ""
231301
232#: init/job_process.c:744302#: init/job_process.c:776
233#, c-format303#, c-format
234msgid "unable to change working directory: %s"304msgid "unable to change working directory: %s"
235msgstr ""305msgstr ""
236306
237#: init/job_process.c:749307#: init/job_process.c:781
238#, c-format308#, c-format
239msgid "unable to set trace: %s"309msgid "unable to set trace: %s"
240msgstr ""310msgstr ""
241311
242#: init/job_process.c:754312#: init/job_process.c:786
243#, c-format313#, c-format
244msgid "unable to execute: %s"314msgid "unable to execute: %s"
245msgstr ""315msgstr ""
246316
247#: init/job_process.c:785317#: init/job_process.c:817 init/job_process.c:867
248#, c-format318#, c-format
249msgid "Sending TERM signal to %s %s process (%d)"319msgid "Sending %s signal to %s %s process (%d)"
250msgstr ""320msgstr ""
251321
252#: init/job_process.c:793322#: init/job_process.c:826 init/job_process.c:876
253#, c-format323#, c-format
254msgid "Failed to send TERM signal to %s %s process (%d): %s"324msgid "Failed to send %s signal to %s %s process (%d): %s"
255msgstr ""325msgstr ""
256326
257#: init/job_process.c:833327#: init/job_process.c:937
258#, c-format
259msgid "Sending KILL signal to %s %s process (%d)"
260msgstr ""
261
262#: init/job_process.c:841
263#, c-format
264msgid "Failed to send KILL signal to %s %s process (%d): %s"
265msgstr ""
266
267#: init/job_process.c:901
268#, c-format328#, c-format
269msgid "%s %s process (%d) terminated with status %d"329msgid "%s %s process (%d) terminated with status %d"
270msgstr ""330msgstr ""
271331
272#: init/job_process.c:906332#: init/job_process.c:942
273#, c-format333#, c-format
274msgid "%s %s process (%d) exited normally"334msgid "%s %s process (%d) exited normally"
275msgstr ""335msgstr ""
276336
277#: init/job_process.c:921337#: init/job_process.c:957
278#, c-format338#, c-format
279msgid "%s %s process (%d) killed by %s signal"339msgid "%s %s process (%d) killed by %s signal"
280msgstr ""340msgstr ""
281341
282#: init/job_process.c:925342#: init/job_process.c:961
283#, c-format343#, c-format
284msgid "%s %s process (%d) killed by signal %d"344msgid "%s %s process (%d) killed by signal %d"
285msgstr ""345msgstr ""
286346
287#: init/job_process.c:939347#: init/job_process.c:975
288#, c-format348#, c-format
289msgid "%s %s process (%d) stopped by %s signal"349msgid "%s %s process (%d) stopped by %s signal"
290msgstr ""350msgstr ""
291351
292#: init/job_process.c:943352#: init/job_process.c:979
293#, c-format353#, c-format
294msgid "%s %s process (%d) stopped by signal %d"354msgid "%s %s process (%d) stopped by signal %d"
295msgstr ""355msgstr ""
296356
297#: init/job_process.c:957357#: init/job_process.c:993
298#, c-format358#, c-format
299msgid "%s %s process (%d) continued by %s signal"359msgid "%s %s process (%d) continued by %s signal"
300msgstr ""360msgstr ""
301361
302#: init/job_process.c:961362#: init/job_process.c:997
303#, c-format363#, c-format
304msgid "%s %s process (%d) continued by signal %d"364msgid "%s %s process (%d) continued by signal %d"
305msgstr ""365msgstr ""
306366
307#: init/job_process.c:1096367#: init/job_process.c:1132
308#, c-format368#, c-format
309msgid "%s respawning too fast, stopped"369msgid "%s respawning too fast, stopped"
310msgstr ""370msgstr ""
311371
312#: init/job_process.c:1102372#: init/job_process.c:1138
313#, c-format373#, c-format
314msgid "%s %s process ended, respawning"374msgid "%s %s process ended, respawning"
315msgstr ""375msgstr ""
316376
317#: init/job_process.c:1342377#: init/job_process.c:1378
318#, c-format378#, c-format
319msgid "Failed to set ptrace options for %s %s process (%d): %s"379msgid "Failed to set ptrace options for %s %s process (%d): %s"
320msgstr ""380msgstr ""
321381
322#: init/job_process.c:1355 init/job_process.c:1550382#: init/job_process.c:1391 init/job_process.c:1586
323#, c-format383#, c-format
324msgid "Failed to continue traced %s %s process (%d): %s"384msgid "Failed to continue traced %s %s process (%d): %s"
325msgstr ""385msgstr ""
326386
327#: init/job_process.c:1395 init/job_process.c:1486 init/job_process.c:1541387#: init/job_process.c:1431 init/job_process.c:1522 init/job_process.c:1577
328#, c-format388#, c-format
329msgid "Failed to detach traced %s %s process (%d): %s"389msgid "Failed to detach traced %s %s process (%d): %s"
330msgstr ""390msgstr ""
331391
332#: init/job_process.c:1435392#: init/job_process.c:1471
333#, c-format393#, c-format
334msgid "Failed to deliver signal to traced %s %s process (%d): %s"394msgid "Failed to deliver signal to traced %s %s process (%d): %s"
335msgstr ""395msgstr ""
336396
337#: init/job_process.c:1470397#: init/job_process.c:1506
338#, c-format398#, c-format
339msgid "Failed to obtain child process id for %s %s process (%d): %s"399msgid "Failed to obtain child process id for %s %s process (%d): %s"
340msgstr ""400msgstr ""
341401
342#: init/job_process.c:1477402#: init/job_process.c:1513
343#, c-format403#, c-format
344msgid "%s %s process (%d) became new process (%d)"404msgid "%s %s process (%d) became new process (%d)"
345msgstr ""405msgstr ""
346406
347#: init/job_process.c:1536407#: init/job_process.c:1572
348#, c-format408#, c-format
349msgid "%s %s process (%d) executable changed"409msgid "%s %s process (%d) executable changed"
350msgstr ""410msgstr ""
351411
352#: init/main.c:117412#: init/main.c:109
413msgid "specify alternative directory to load configuration files from"
414msgstr ""
415
416#: init/main.c:114
417msgid "use D-Bus session bus rather than system bus (for testing)"
418msgstr ""
419
420#: init/main.c:134
353msgid "Process management daemon."421msgid "Process management daemon."
354msgstr ""422msgstr ""
355423
356#: init/main.c:119424#: init/main.c:136
357msgid ""425msgid ""
358"This daemon is normally executed by the kernel and given process id 1 to "426"This daemon is normally executed by the kernel and given process id 1 to "
359"denote its special status. When executed by a user process, it will "427"denote its special status. When executed by a user process, it will "
360"actually run /sbin/telinit."428"actually run /sbin/telinit."
361msgstr ""429msgstr ""
362430
363#: init/main.c:130 util/reboot.c:167 util/shutdown.c:363 util/telinit.c:148431#: init/main.c:152 util/reboot.c:166 util/shutdown.c:363 util/telinit.c:148
364msgid "Need to be root"432msgid "Need to be root"
365msgstr ""433msgstr ""
366434
367#: init/main.c:139435#: init/main.c:161
368msgid "Not being executed as init"436msgid "Not being executed as init"
369msgstr ""437msgstr ""
370438
371#: init/main.c:187 init/main.c:456439#: init/main.c:209 init/main.c:492
372msgid "Unable to set root directory"440msgid "Unable to set root directory"
373msgstr ""441msgstr ""
374442
375#: init/main.c:198443#: init/main.c:220
376msgid "Unable to mount /proc filesystem"444msgid "Unable to mount /proc filesystem"
377msgstr ""445msgstr ""
378446
379#: init/main.c:207447#: init/main.c:229
380msgid "Unable to mount /sys filesystem"448msgid "Unable to mount /sys filesystem"
381msgstr ""449msgstr ""
382450
383#: init/main.c:292451#: init/main.c:325
384msgid "Unable to listen for private connections"452msgid "Unable to listen for private connections"
385msgstr ""453msgstr ""
386454
387#: init/main.c:473455#: init/main.c:509
388#, c-format456#, c-format
389msgid "Caught %s, core dumped"457msgid "Caught %s, core dumped"
390msgstr ""458msgstr ""
391459
392#: init/main.c:477460#: init/main.c:513
393#, c-format461#, c-format
394msgid "Caught %s, unable to dump core"462msgid "Caught %s, unable to dump core"
395msgstr ""463msgstr ""
396464
397#: init/main.c:563465#: init/main.c:599
398msgid "Reconnecting to system bus"466msgid "Reconnecting to system bus"
399msgstr ""467msgstr ""
400468
401#: init/main.c:569469#: init/main.c:605
402msgid "Unable to connect to the system bus"470msgid "Unable to connect to the system bus"
403msgstr ""471msgstr ""
404472
@@ -589,59 +657,59 @@
589"Without arguments, this outputs the current log priority."657"Without arguments, this outputs the current log priority."
590msgstr ""658msgstr ""
591659
592#: util/reboot.c:114660#: util/reboot.c:113
593msgid "don't sync before reboot or halt"661msgid "don't sync before reboot or halt"
594msgstr ""662msgstr ""
595663
596#: util/reboot.c:116664#: util/reboot.c:115
597msgid "force reboot or halt, don't call shutdown(8)"665msgid "force reboot or halt, don't call shutdown(8)"
598msgstr ""666msgstr ""
599667
600#: util/reboot.c:118668#: util/reboot.c:117
601msgid "switch off the power when called as halt"669msgid "switch off the power when called as halt"
602msgstr ""670msgstr ""
603671
604#: util/reboot.c:120672#: util/reboot.c:119
605msgid "don't actually reboot or halt, just write wtmp record"673msgid "don't actually reboot or halt, just write wtmp record"
606msgstr ""674msgstr ""
607675
608#: util/reboot.c:145676#: util/reboot.c:144
609msgid "Halt the system."677msgid "Halt the system."
610msgstr ""678msgstr ""
611679
612#: util/reboot.c:148680#: util/reboot.c:147
613msgid "Power off the system."681msgid "Power off the system."
614msgstr ""682msgstr ""
615683
616#: util/reboot.c:151684#: util/reboot.c:150
617msgid "Reboot the system."685msgid "Reboot the system."
618msgstr ""686msgstr ""
619687
620#: util/reboot.c:155688#: util/reboot.c:154
621msgid ""689msgid ""
622"This command is intended to instruct the kernel to reboot or halt the "690"This command is intended to instruct the kernel to reboot or halt the "
623"system; when run without the -f option, or when in a system runlevel other "691"system; when run without the -f option, or when in a system runlevel other "
624"than 0 or 6, it will actually execute /sbin/shutdown.\n"692"than 0 or 6, it will actually execute /sbin/shutdown.\n"
625msgstr ""693msgstr ""
626694
627#: util/reboot.c:211695#: util/reboot.c:210
628msgid "Calling shutdown"696msgid "Calling shutdown"
629msgstr ""697msgstr ""
630698
631#: util/reboot.c:214699#: util/reboot.c:213
632#, c-format700#, c-format
633msgid "Unable to execute shutdown: %s"701msgid "Unable to execute shutdown: %s"
634msgstr ""702msgstr ""
635703
636#: util/reboot.c:235704#: util/reboot.c:234
637msgid "Rebooting"705msgid "Rebooting"
638msgstr ""706msgstr ""
639707
640#: util/reboot.c:239708#: util/reboot.c:238
641msgid "Halting"709msgid "Halting"
642msgstr ""710msgstr ""
643711
644#: util/reboot.c:243712#: util/reboot.c:242
645msgid "Powering off"713msgid "Powering off"
646msgstr ""714msgstr ""
647715
648716
=== modified file 'util/reboot.c'
--- util/reboot.c 2011-03-16 22:18:22 +0000
+++ util/reboot.c 2011-06-03 09:09:24 +0000
@@ -1,6 +1,5 @@
1/* upstart1/* upstart
2 *2 *
3 * Copyright © 2011 Google Inc.
4 * Copyright © 2010 Canonical Ltd.3 * Copyright © 2010 Canonical Ltd.
5 * Author: Scott James Remnant <scott@netsplit.com>.4 * Author: Scott James Remnant <scott@netsplit.com>.
6 *5 *

Subscribers

People subscribed via source and target branches