Merge lp:~jamesodhunt/upstart/bug-1338637 into lp:upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1643
Proposed branch: lp:~jamesodhunt/upstart/bug-1338637
Merge into: lp:upstart
Diff against target: 104 lines (+47/-32)
2 files modified
ChangeLog (+6/-0)
init/main.c (+41/-32)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/bug-1338637
Reviewer Review Type Date Requested Status
Upstart Reviewers Pending
Review via email: mp+225945@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

ouch!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2014-07-07 10:15:25 +0000
+++ ChangeLog 2014-07-08 10:07:29 +0000
@@ -1,3 +1,9 @@
12014-07-08 James Hunt <james.hunt@ubuntu.com>
2
3 * init/main.c: main():
4 - Only create inotify watches if not restarting or if performing a
5 stateless re-exec (LP: #1338637).
6
12014-07-07 James Hunt <james.hunt@ubuntu.com>72014-07-07 James Hunt <james.hunt@ubuntu.com>
28
3 * init/tests/test_job_process.c: test_handler():9 * init/tests/test_job_process.c: test_handler():
410
=== modified file 'init/main.c'
--- init/main.c 2014-06-05 22:35:01 +0000
+++ init/main.c 2014-07-08 10:07:29 +0000
@@ -601,38 +601,44 @@
601 }601 }
602 }602 }
603603
604 /* Read configuration */604 /* Only honour command-line options affecting configuration
605 if (prepend_conf_dirs[0]) {605 * directories if not restarting, or if performing a stateless
606 for (char **d = prepend_conf_dirs; d && *d; d++) {606 * re-exec.
607 nih_debug ("Prepending configuration directory %s", *d);607 */
608 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));608 if (! restart || (restart && state_fd == -1)) {
609 }609 /* Read configuration */
610 }610 if (prepend_conf_dirs[0]) {
611611 for (char **d = prepend_conf_dirs; d && *d; d++) {
612 if (! user_mode) {612 nih_debug ("Prepending configuration directory %s", *d);
613 nih_assert (conf_dirs[0]);613 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));
614614 }
615 NIH_MUST (conf_source_new (NULL, CONFFILE, CONF_FILE));615 }
616616
617 for (char **d = conf_dirs; d && *d; d++) {617 if (! user_mode) {
618 nih_debug ("Using configuration directory %s", *d);618 nih_assert (conf_dirs[0]);
619 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));619
620 }620 NIH_MUST (conf_source_new (NULL, CONFFILE, CONF_FILE));
621 } else {621
622 nih_local char **dirs = NULL;622 for (char **d = conf_dirs; d && *d; d++) {
623623 nih_debug ("Using configuration directory %s", *d);
624 dirs = NIH_MUST (get_user_upstart_dirs ());624 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));
625625 }
626 for (char **d = conf_dirs[0] ? conf_dirs : dirs; d && *d; d++) {626 } else {
627 nih_debug ("Using configuration directory %s", *d);627 nih_local char **dirs = NULL;
628 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));628
629 }629 dirs = NIH_MUST (get_user_upstart_dirs ());
630 }630
631631 for (char **d = conf_dirs[0] ? conf_dirs : dirs; d && *d; d++) {
632 if (append_conf_dirs[0]) {632 nih_debug ("Using configuration directory %s", *d);
633 for (char **d = append_conf_dirs; d && *d; d++) {633 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));
634 nih_debug ("Adding configuration directory %s", *d);634 }
635 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));635 }
636
637 if (append_conf_dirs[0]) {
638 for (char **d = append_conf_dirs; d && *d; d++) {
639 nih_debug ("Adding configuration directory %s", *d);
640 NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR));
641 }
636 }642 }
637 }643 }
638644
@@ -644,6 +650,9 @@
644650
645 conf_reload ();651 conf_reload ();
646652
653 /* We must have atleast one source of configuration */
654 nih_assert (! NIH_LIST_EMPTY (conf_sources));
655
647 /* Create a listening server for private connections. */656 /* Create a listening server for private connections. */
648 if (use_session_bus == FALSE) {657 if (use_session_bus == FALSE) {
649 while (control_server_open () < 0) {658 while (control_server_open () < 0) {

Subscribers

People subscribed via source and target branches