lightdm's post-stop sometimes fails
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_
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.
To clarify, this occurs on both Precise and Quantal.