Dimitri John Ledkov has proposed merging lp:~xnox/upstart/fix-private-telinit
into lp:upstart.
Requested reviews:
Upstart Reviewers (upstart-reviewers)
For more details, see:
https://code.launchpad.net/~xnox/upstart/fix-private-telinit/+merge/210209
--
https://code.launchpad.net/~xnox/upstart/fix-private-telinit/+merge/210209
Your team Upstart Reviewers is requested to review the proposed merge of
lp:~xnox/upstart/fix-private-telinit into lp:upstart.
=== 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 @@
# create a job and start it, marking it such that the .conf file
# will be retained when object becomes unusable (after re-exec).
- job = self.upstart.job_create('sleeper', 'exec sleep 123', retain=True)
+ job = self.upstart.job_create('connected-job', ['exec upstart-udev-bridge', 'respawn'], retain=True)
self.assertTrue(job)
# Used when recreating the job
@@ -103,11 +103,11 @@
self.assertEqual(version, version_postexec)
# Ensure the job is still running with the same PID
- os.kill(pid, 0)
+ self.assertRaises(ProcessLookupError, os.kill, pid, 0)
# XXX: The re-exec will have severed the D-Bus connection to
# Upstart. Hence, revivify the job with some magic.
- job = self.upstart.job_recreate('sleeper', conf_path)
+ job = self.upstart.job_recreate('connected-job', conf_path)
self.assertTrue(job)
# Recreate the instance
@@ -119,8 +119,8 @@
self.assertEqual(len(pids), 1)
self.assertTrue(pids['main'])
- # The pid should not have changed after a restart
- self.assertEqual(pid, pids['main'])
+ # The pid _must_ have changed after a restart
+ self.assertNotEqual(pid, pids['main'])
job.stop()
=== 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 @@
* Upstart has severed all connections to perform the re-exec.
*/
ret = upstart_restart (upstart, NULL, NULL, NULL, 0);
+ dbus_connection_flush(upstart->connection);
/* We don't care about the return code, but we have to keep
* the compiler happy.
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel