Merge lp:~zyga/checkbox/fix-1413134 into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 3539
Merged at revision: 3542
Proposed branch: lp:~zyga/checkbox/fix-1413134
Merge into: lp:checkbox
Diff against target: 24 lines (+6/-1)
1 file modified
providers/plainbox-provider-checkbox/bin/pm_test (+6/-1)
To merge this branch: bzr merge lp:~zyga/checkbox/fix-1413134
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Review via email: mp+247149@code.launchpad.net

Description of the change

04dc495 providers:checkbox: run {poweroff,reboot} in the foreground

This can be verified by running:

sudo ./providers/plainbox-provider-checkbox/bin/pm_test poweroff; echo 'FAILED' > ~/did-it-fail

And checking the contents of ~/did-it-fail after re-powering the machine.

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

I've run a couple of tests to check how this change affects https://bugs.launchpad.net/plainbox/+bug/1403832
By making pm_test run comamnds serially (instead of forking) it solves the rebooting problem as well.

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

+1, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/bin/pm_test'
2--- providers/plainbox-provider-checkbox/bin/pm_test 2014-12-07 22:46:56 +0000
3+++ providers/plainbox-provider-checkbox/bin/pm_test 2015-01-21 14:22:07 +0000
4@@ -7,6 +7,7 @@
5 import shutil
6 import subprocess
7 import sys
8+import signal
9
10 from argparse import ArgumentParser, SUPPRESS
11 from calendar import timegm
12@@ -143,7 +144,11 @@
13 logging.info('Executing new {0!r} operation...'
14 .format(self.args.pm_operation))
15 logging.debug('Executing: {0!r}...'.format(command_str))
16- subprocess.Popen(command_str, shell=True)
17+ # The PM operation is performed asynchronously so let's just wait
18+ # indefinitely until it happens and someone comes along to kill us.
19+ # This addresses LP: #1413134
20+ subprocess.check_call(command_str, shell=True)
21+ signal.pause()
22
23 def summary(self):
24 """

Subscribers

People subscribed via source and target branches