lightdm's post-stop sometimes fails

Bug #1111537 reported by Jonathan Reed
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In our somewhat complicated environment, I've managed to trigger a race condition in which shutting down or rebooting the machine from a (custom) lightdm greeter results in the machine popping up the "low graphics mode" warning, and never shutting down. The greeter is using the Python GIR bindings to call LightDM.shutdown() and LightDM.restart(), respectively, so I'm fairly certain it's not the greeter's fault.

I finally tracked this down to the post-stop script in lightdm's upstart job, namely that "initctl emit desktop-shutdown" is sometimes returning non-zero. Because all Upstart jobs are run with "set -e", lightdm fails, and Upstart then decides that X isn't working and pops up the low-graphics mode warning.

Adding the usual "|| :" idiom fixes this, e.g.

   post-stop script
 if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
  initctl emit desktop-shutdown || :
 fi
   end script

I think this is the right thing to do anyway, because if lightdm is being stopped, and for whatever reason, the desktop-shutdown signal is not emitted, there's not a good way to recover from that anyway, so it shouldn't be a fatal failure. This is hard to reproduce (indeed, my steps to reproduce include "Try this about 30 times until it fails". While on a single machine, this is not a big deal, distributed over 400 heavily used public machines, it's becoming a real problem), but the fix is easy and a no-op, so I would hope it would be considered anyway.

Revision history for this message
Jonathan Reed (jdreed) wrote :

To clarify, this occurs on both Precise and Quantal.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lightdm (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.