Public bug reported:

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.

** Affects: lightdm (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1111537

Title:
  lightdm's post-stop sometimes fails

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1111537/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to