Merge lp:~didrocks/ubiquity/fix-crash-on-reboot into lp:ubiquity

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: 6631
Proposed branch: lp:~didrocks/ubiquity/fix-crash-on-reboot
Merge into: lp:ubiquity
Diff against target: 82 lines (+25/-36)
2 files modified
debian/changelog (+11/-0)
ubiquity/frontend/gtk_ui.py (+14/-36)
To merge this branch: bzr merge lp:~didrocks/ubiquity/fix-crash-on-reboot
Reviewer Review Type Date Requested Status
Iain Lane Approve
Jean-Baptiste Lallement Approve
Sebastien Bacher (community) Approve
Review via email: mp+344215@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Tested in live session, selecting reboot once install is done. Works.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Works fine in ubiquity-dm as well and makes sense from a code review

review: Approve
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Verified from the live session and ubiquity-only mode. Both are working.

review: Approve
6632. By Didier Roche-Tolomelli

Remove broken gnome-session code completely

Revision history for this message
Iain Lane (laney) wrote :

thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2018-04-24 15:29:36 +0000
3+++ debian/changelog 2018-04-25 09:24:42 +0000
4@@ -1,3 +1,14 @@
5+ubiquity (18.04.12) UNRELEASED; urgency=medium
6+
7+ * Request shutdown and reboot without using gnome-session (LP: #1766811)
8+ The if gnome_session code path doesn't declare the GNOME
9+ session interface it's using, so don't work.
10+ Even fixing it, we notice that calls aren't wired in GNOME session code.
11+ Fallback thus for now to old code path which is executed at least
12+ since xenial (when DBUS address wasn't correct in ubiquity process)
13+
14+ -- Didier Roche <didrocks@ubuntu.com> Wed, 25 Apr 2018 10:14:19 +0200
15+
16 ubiquity (18.04.11) bionic; urgency=medium
17
18 [ Sebastien Bacher]
19
20=== modified file 'ubiquity/frontend/gtk_ui.py'
21--- ubiquity/frontend/gtk_ui.py 2018-04-24 13:52:00 +0000
22+++ ubiquity/frontend/gtk_ui.py 2018-04-25 09:24:42 +0000
23@@ -1407,45 +1407,23 @@
24
25 def do_reboot(self):
26 """Callback for main program to actually reboot the machine."""
27- try:
28- session = dbus.Bus.get_session()
29- gnome_session = session.name_has_owner('org.gnome.SessionManager')
30- except dbus.exceptions.DBusException:
31- gnome_session = False
32-
33- if gnome_session:
34- manager = session.get_object('org.gnome.SessionManager',
35- '/org/gnome/SessionManager')
36- manager.RequestReboot()
37- else:
38- # don't let reboot race with the shutdown of X in ubiquity-dm;
39- # reboot might be too fast and X will stay around forever instead
40- # of moving to plymouth
41- misc.execute_root(
42- "sh", "-c",
43- "if ! service display-manager status; then killall Xorg; "
44- "while pidof X; do sleep 0.5; done; fi; reboot")
45+ # don't let reboot race with the shutdown of X in ubiquity-dm;
46+ # reboot might be too fast and X will stay around forever instead
47+ # of moving to plymouth
48+ misc.execute_root(
49+ "sh", "-c",
50+ "if ! service display-manager status; then killall Xorg; "
51+ "while pidof X; do sleep 0.5; done; fi; reboot")
52
53 def do_shutdown(self):
54 """Callback for main program to actually shutdown the machine."""
55- try:
56- session = dbus.Bus.get_session()
57- gnome_session = session.name_has_owner('org.gnome.SessionManager')
58- except dbus.exceptions.DBusException:
59- gnome_session = False
60-
61- if gnome_session:
62- manager = session.get_object('org.gnome.SessionManager',
63- '/org/gnome/SessionManager')
64- manager.RequestShutdown()
65- else:
66- # don't let poweroff race with the shutdown of X in ubiquity-dm;
67- # poweroff might be too fast and X will stay around forever instead
68- # of moving to plymouth
69- misc.execute_root(
70- "sh", "-c",
71- "if ! service display-manager status; then killall Xorg; "
72- "while pidof X; do sleep 0.5; done; fi; poweroff")
73+ # don't let poweroff race with the shutdown of X in ubiquity-dm;
74+ # poweroff might be too fast and X will stay around forever instead
75+ # of moving to plymouth
76+ misc.execute_root(
77+ "sh", "-c",
78+ "if ! service display-manager status; then killall Xorg; "
79+ "while pidof X; do sleep 0.5; done; fi; poweroff")
80
81 def quit_installer(self, *args):
82 """Quit installer cleanly."""

Subscribers

People subscribed via source and target branches

to status/vote changes: