Merge lp:~xnox/upstart/fix-private-telinit into lp:upstart

Proposed by Dimitri John Ledkov on 2014-03-10
Status: Merged
Merged at revision: 1609
Proposed branch: lp:~xnox/upstart/fix-private-telinit
Merge into: lp:upstart
Diff against target: 49 lines (+6/-5)
2 files modified
scripts/tests/test_pyupstart_system_init.py (+5/-5)
util/telinit.c (+1/-0)
To merge this branch: bzr merge lp:~xnox/upstart/fix-private-telinit
Reviewer Review Type Date Requested Status
James Hunt 2014-03-10 Approve on 2014-03-11
Review via email: mp+210209@code.launchpad.net
To post a comment you must log in.
James Hunt (jamesodhunt) wrote :

LGTM - thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/tests/test_pyupstart_system_init.py'
--- scripts/tests/test_pyupstart_system_init.py 2014-03-05 10:34:32 +0000
+++ scripts/tests/test_pyupstart_system_init.py 2014-03-10 13:48:48 +0000
@@ -73,7 +73,7 @@
7373
74 # create a job and start it, marking it such that the .conf file74 # create a job and start it, marking it such that the .conf file
75 # will be retained when object becomes unusable (after re-exec).75 # will be retained when object becomes unusable (after re-exec).
76 job = self.upstart.job_create('sleeper', 'exec sleep 123', retain=True)76 job = self.upstart.job_create('connected-job', ['exec upstart-udev-bridge', 'respawn'], retain=True)
77 self.assertTrue(job)77 self.assertTrue(job)
7878
79 # Used when recreating the job79 # Used when recreating the job
@@ -103,11 +103,11 @@
103 self.assertEqual(version, version_postexec)103 self.assertEqual(version, version_postexec)
104104
105 # Ensure the job is still running with the same PID105 # Ensure the job is still running with the same PID
106 os.kill(pid, 0)106 self.assertRaises(ProcessLookupError, os.kill, pid, 0)
107107
108 # XXX: The re-exec will have severed the D-Bus connection to108 # XXX: The re-exec will have severed the D-Bus connection to
109 # Upstart. Hence, revivify the job with some magic.109 # Upstart. Hence, revivify the job with some magic.
110 job = self.upstart.job_recreate('sleeper', conf_path)110 job = self.upstart.job_recreate('connected-job', conf_path)
111 self.assertTrue(job)111 self.assertTrue(job)
112112
113 # Recreate the instance113 # Recreate the instance
@@ -119,8 +119,8 @@
119 self.assertEqual(len(pids), 1)119 self.assertEqual(len(pids), 1)
120 self.assertTrue(pids['main'])120 self.assertTrue(pids['main'])
121121
122 # The pid should not have changed after a restart122 # The pid _must_ have changed after a restart
123 self.assertEqual(pid, pids['main'])123 self.assertNotEqual(pid, pids['main'])
124124
125 job.stop()125 job.stop()
126126
127127
=== modified file 'util/telinit.c'
--- util/telinit.c 2014-01-15 11:51:18 +0000
+++ util/telinit.c 2014-03-10 13:48:48 +0000
@@ -174,6 +174,7 @@
174 * Upstart has severed all connections to perform the re-exec.174 * Upstart has severed all connections to perform the re-exec.
175 */175 */
176 ret = upstart_restart (upstart, NULL, NULL, NULL, 0);176 ret = upstart_restart (upstart, NULL, NULL, NULL, 0);
177 dbus_connection_flush(upstart->connection);
177178
178 /* We don't care about the return code, but we have to keep179 /* We don't care about the return code, but we have to keep
179 * the compiler happy.180 * the compiler happy.

Subscribers

People subscribed via source and target branches