Merge lp:~townsend/lightdm/fix-plymouthd-spin into lp:~mir-team/lightdm/unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Robert Ancell
Approved revision: 1635
Merged at revision: 1636
Proposed branch: lp:~townsend/lightdm/fix-plymouthd-spin
Merge into: lp:~mir-team/lightdm/unity
Diff against target: 90 lines (+12/-25)
4 files modified
src/plymouth.c (+2/-22)
src/plymouth.h (+1/-1)
src/seat-unity.c (+8/-1)
src/xserver-local.c (+1/-1)
To merge this branch: bzr merge lp:~townsend/lightdm/fix-plymouthd-spin
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Daniel van Vugt Needs Information
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+174874@code.launchpad.net

Commit message

* Revert the workaround introduced in revno. 1619.
* Add in handling of "plymouth quit" when using the compositor to send the plymouth commands to deactivate and quit. (LP: #1192051)

Description of the change

In Xmir, the compositor start up is supposed to handle the interaction with plymouth unlike X only in which xserver-local does this. However, it is lacking a call to plymouth_quit(), so plymouthd will spin forever since nothing told it to quit.

This fix uses the stopping_plymouth boolean to set when to run plymouth_quit(). I think this is a bug in upstream lightdm as well since nothing ever sets that boolean to TRUE, rendering this a useless variable.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I thought the absence of plymouth_quit wass correct. Lightdm is not meant to quit plymouth, only deactivate it...

I thought you should not want plymouth quit because we needed a faster and smoother transition on startup, which deactivate gives you(?). But I also can't see any reason why plymouthd should keep running, so quit might make sense.

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

See also: /etc/init/plymouth-stop.conf
which is intended to quit plymouth. But apparently not with lightdm...

Revision history for this message
Christopher Townsend (townsend) wrote :

@Daniel,

Thanks for looking over this. I also thought deactivate was a more graceful way of shutting down plymouth, but I've looked through the plymouth code and basically all deactivate does is stop displaying the splash screen. There is no code in the deactivate path to kill the plymouthd process.

Also, when using the X only setup, "plymouth quit" is indeed called by xserver-local in lightdm and this is what kills off the plymouthd process. So what I did is took how xserver-local handles that and apply it to when the compositor is handling the plymouth duties. I think this is a bug in upstream lightdm as well, but it was undiscovered since xserver-local has been handling these duties until now.

The reason your workaround appeared to work is that is actually caused plymouthd to segfault. After the first deactivate is done, some pointers are NULLed out and the subsequent call to deactivate dereferences the null pointer. I think that is a bug as well, but not this bug we are trying to fix:)

I hope this helps explain my findings and rationale for this MP. I also put a bit more detail in the bug itself about this.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks Christopher! Looking into it you're completely right - the Unity seat was not behaving like the X seat. I've pushed this to trunk with a regression test that confirms and checks the behaviour (lp:~robert-ancell/lightdm/unity-plymouth-fix).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/plymouth.c'
--- src/plymouth.c 2013-07-01 03:40:17 +0000
+++ src/plymouth.c 2013-07-15 21:50:44 +0000
@@ -81,30 +81,10 @@
81}81}
8282
83void83void
84plymouth_deactivate (gboolean wait)84plymouth_deactivate (void)
85{85{
86 gint attempt = 1;
87 is_active = FALSE;86 is_active = FALSE;
8887 plymouth_run_command ("deactivate", NULL);
89 /*
90 * The "plymouth" command has no option like --wait-for-deactivation so
91 * we have to wait in a loop.
92 */
93 do
94 {
95 g_debug("Deactivating Plymouth (attempt #%d)", attempt);
96 attempt++;
97 plymouth_run_command ("deactivate", NULL);
98
99 if (!wait)
100 return;
101
102 sleep (1);
103 have_checked_active_vt = FALSE;
104 } while (plymouth_has_active_vt () && attempt <= 60);
105
106 if (has_active_vt)
107 g_debug("Failed to deactivate Plymouth.");
108}88}
10989
110void90void
11191
=== modified file 'src/plymouth.h'
--- src/plymouth.h 2013-07-01 03:40:17 +0000
+++ src/plymouth.h 2013-07-15 21:50:44 +0000
@@ -22,7 +22,7 @@
2222
23gboolean plymouth_has_active_vt (void);23gboolean plymouth_has_active_vt (void);
2424
25void plymouth_deactivate (gboolean wait);25void plymouth_deactivate (void);
2626
27void plymouth_quit (gboolean retain_splash);27void plymouth_quit (gboolean retain_splash);
2828
2929
=== modified file 'src/seat-unity.c'
--- src/seat-unity.c 2013-07-01 05:10:33 +0000
+++ src/seat-unity.c 2013-07-15 21:50:44 +0000
@@ -146,6 +146,12 @@
146 close (fd);146 close (fd);
147 }147 }
148 }148 }
149
150 if(seat->priv->stopping_plymouth)
151 {
152 seat->priv->stopping_plymouth = FALSE;
153 plymouth_quit(TRUE);
154 }
149}155}
150156
151static void157static void
@@ -309,8 +315,9 @@
309 if (active_vt >= vt_get_min ())315 if (active_vt >= vt_get_min ())
310 {316 {
311 g_debug ("Compositor will replace Plymouth");317 g_debug ("Compositor will replace Plymouth");
318 SEAT_UNITY (seat)->priv->stopping_plymouth = TRUE;
312 SEAT_UNITY (seat)->priv->vt = active_vt;319 SEAT_UNITY (seat)->priv->vt = active_vt;
313 plymouth_deactivate (TRUE);320 plymouth_deactivate ();
314 }321 }
315 else322 else
316 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());323 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());
317324
=== modified file 'src/xserver-local.c'
--- src/xserver-local.c 2013-07-01 03:40:17 +0000
+++ src/xserver-local.c 2013-07-15 21:50:44 +0000
@@ -170,7 +170,7 @@
170 g_debug ("X server %s will replace Plymouth", xserver_get_address (XSERVER (self)));170 g_debug ("X server %s will replace Plymouth", xserver_get_address (XSERVER (self)));
171 self->priv->replacing_plymouth = TRUE;171 self->priv->replacing_plymouth = TRUE;
172 self->priv->vt = active_vt;172 self->priv->vt = active_vt;
173 plymouth_deactivate (FALSE);173 plymouth_deactivate ();
174 }174 }
175 else175 else
176 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());176 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());

Subscribers

People subscribed via source and target branches