Merge lp:~mterry/ubuntu-system-settings/crashed-socket into lp:ubuntu-system-settings

Proposed by Michael Terry
Status: Merged
Approved by: Ken VanDine
Approved revision: 1062
Merged at revision: 1079
Proposed branch: lp:~mterry/ubuntu-system-settings/crashed-socket
Merge into: lp:ubuntu-system-settings
Diff against target: 100 lines (+36/-26)
2 files modified
wizard/ubuntu-system-settings-wizard-cleanup.conf (+4/-25)
wizard/ubuntu-system-settings-wizard.conf (+32/-1)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/crashed-socket
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+235352@code.launchpad.net

Commit message

Prevent a crash in unity8 when the wizard also crashes or stops early. (LP: #1355892)

Move some of the socket cleanup from the 'cleanup' wizard job to the main job, while also avoiding the race that would create by stopping and starting unity8's job more carefully.

Description of the change

Prevent a crash in unity8 when the wizard also crashes or stops early. (LP: #1355892)

Move some of the socket cleanup from the 'cleanup' wizard job to the main job, while also avoiding the race that would create by stopping and starting unity8's job more carefully.

== Checklist ==

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
 Yes

 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
 NA, just upstart changes

 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
 NA, just upstart changes

 * Has your component "TestPlan” been executed successfully on emulator, N4?
 Yes

 * Has a 5 minute exploratory testing run been executed on N4?
 Yes

 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 NA

 * If you changed the UI, did you subscribe the design-reviewers to this MP?
 NA

 * What components might get impacted by your changes?
 Just wizard

 * Have you requested review by the teams of these owning components?
 Yeah

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, looks fine in principle to me but I can't test it due to the issue I mentioned on https://code.launchpad.net/~mterry/ubuntu-system-settings/flickable-passwd-page/+merge/235117

Comment approving but letting somebody who can run the wizard to change the status

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wizard/ubuntu-system-settings-wizard-cleanup.conf'
2--- wizard/ubuntu-system-settings-wizard-cleanup.conf 2014-09-02 12:44:42 +0000
3+++ wizard/ubuntu-system-settings-wizard-cleanup.conf 2014-09-20 00:42:11 +0000
4@@ -1,11 +1,8 @@
5 description "Welcome to Ubuntu Cleanup"
6 author "Michael Terry <michael.terry@canonical.com>"
7
8-# These are all tasks that need to be completed after wizard is done, but
9-# before unity8 starts. We pause unity8 bring-up by starting the wizard on
10-# "starting unity8" but as soon as we try to kill/stop the wizard, upstart
11-# will begin running unity8. So instead, we start this job which ends our main
12-# wizard task when done.
13+# These are all tasks that need to be completed only if the wizard was
14+# intentionally stopped (i.e. the user clicked 'Finish' at the end)
15
16 task
17
18@@ -13,29 +10,11 @@
19 env RUN_FILE=".config/ubuntu-system-settings/wizard-has-run"
20
21 script
22- setenv() {
23- initctl set-env --global $1=$2
24- gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'$1': '$2'}"
25- }
26-
27- echo "Ending wizard"
28- # Undo changes to global variables
29- if [ -n "$WIZARD_ORIG_MIR_SOCKET" ]; then
30- echo "Resetting MIR_SOCKET to $WIZARD_ORIG_MIR_SOCKET"
31- setenv MIR_SOCKET $WIZARD_ORIG_MIR_SOCKET
32- fi
33-
34- # Stop any indicators and OSK so they will be restarted with new environment
35- initctl emit indicator-services-end
36- stop maliit-server || true
37-end script
38-
39-post-stop script
40- stop ubuntu-system-settings-wizard
41-
42 # Don't run again in the future. We do this here, rather than in the main
43 # job because we only want to run this code if user actually clicked on the
44 # "Finish" button.
45 mkdir -p $(dirname "$HOME/$RUN_FILE")
46 touch "$HOME/$RUN_FILE" || true
47+
48+ stop ubuntu-system-settings-wizard
49 end script
50
51=== modified file 'wizard/ubuntu-system-settings-wizard.conf'
52--- wizard/ubuntu-system-settings-wizard.conf 2014-08-18 13:09:48 +0000
53+++ wizard/ubuntu-system-settings-wizard.conf 2014-09-20 00:42:11 +0000
54@@ -11,8 +11,13 @@
55
56 pre-start script
57 if [ -e "$HOME/$RUN_FILE" ]; then
58+ initctl set-env WIZARD_SKIPPED=true
59 stop
60 else
61+ # Stop unity8, we'll start it again in post-stop (this avoids a race
62+ # between post-stop and unity8 unpausing)
63+ stop --no-wait $JOB
64+
65 # Tell unity-mir to raise SIGSTOP after we start
66 initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
67
68@@ -40,5 +45,31 @@
69 exec system-settings-wizard
70
71 post-stop script
72- rm -f "$XDG_RUNTIME_DIR/wizard_socket"
73+ if [ -n "$WIZARD_SKIPPED" ]; then
74+ exit
75+ fi
76+
77+ setenv() {
78+ initctl set-env --global $1=$2
79+ gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'$1': '$2'}"
80+ }
81+
82+ echo "Ending wizard"
83+
84+ if [ -S "$MIR_SERVER_FILE" ]; then
85+ rm -f "$MIR_SERVER_FILE"
86+ fi
87+
88+ # Undo changes to global variables
89+ if [ -n "$WIZARD_ORIG_MIR_SOCKET" ]; then
90+ echo "Resetting MIR_SOCKET to $WIZARD_ORIG_MIR_SOCKET"
91+ setenv MIR_SOCKET $WIZARD_ORIG_MIR_SOCKET
92+ fi
93+
94+ # Stop any indicators and OSK so they will be restarted with new environment
95+ initctl emit indicator-services-end
96+ stop maliit-server || true
97+
98+ # And finally, resume unity8
99+ start --no-wait $JOB || true
100 end script

Subscribers

People subscribed via source and target branches