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

Proposed by Dimitri John Ledkov
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 Approve
Review via email: mp+210209@code.launchpad.net
To post a comment you must log in.
Revision history for this message
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
1=== modified file 'scripts/tests/test_pyupstart_system_init.py'
2--- scripts/tests/test_pyupstart_system_init.py 2014-03-05 10:34:32 +0000
3+++ scripts/tests/test_pyupstart_system_init.py 2014-03-10 13:48:48 +0000
4@@ -73,7 +73,7 @@
5
6 # create a job and start it, marking it such that the .conf file
7 # will be retained when object becomes unusable (after re-exec).
8- job = self.upstart.job_create('sleeper', 'exec sleep 123', retain=True)
9+ job = self.upstart.job_create('connected-job', ['exec upstart-udev-bridge', 'respawn'], retain=True)
10 self.assertTrue(job)
11
12 # Used when recreating the job
13@@ -103,11 +103,11 @@
14 self.assertEqual(version, version_postexec)
15
16 # Ensure the job is still running with the same PID
17- os.kill(pid, 0)
18+ self.assertRaises(ProcessLookupError, os.kill, pid, 0)
19
20 # XXX: The re-exec will have severed the D-Bus connection to
21 # Upstart. Hence, revivify the job with some magic.
22- job = self.upstart.job_recreate('sleeper', conf_path)
23+ job = self.upstart.job_recreate('connected-job', conf_path)
24 self.assertTrue(job)
25
26 # Recreate the instance
27@@ -119,8 +119,8 @@
28 self.assertEqual(len(pids), 1)
29 self.assertTrue(pids['main'])
30
31- # The pid should not have changed after a restart
32- self.assertEqual(pid, pids['main'])
33+ # The pid _must_ have changed after a restart
34+ self.assertNotEqual(pid, pids['main'])
35
36 job.stop()
37
38
39=== modified file 'util/telinit.c'
40--- util/telinit.c 2014-01-15 11:51:18 +0000
41+++ util/telinit.c 2014-03-10 13:48:48 +0000
42@@ -174,6 +174,7 @@
43 * Upstart has severed all connections to perform the re-exec.
44 */
45 ret = upstart_restart (upstart, NULL, NULL, NULL, 0);
46+ dbus_connection_flush(upstart->connection);
47
48 /* We don't care about the return code, but we have to keep
49 * the compiler happy.

Subscribers

People subscribed via source and target branches