Comment 4 for bug 854329

Revision history for this message
Steve Langasek (vorlon) wrote :

Yeah, don't use that script. $UPSTART_EVENTS is the variable containing the list of events that triggered the *start* of the job; so anything that's 'start on [...] runlevel [...]' will always match and then we have the same race condition all over again.

Here's an alternative that DTRT.
post-stop script
        if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
                initctl emit desktop-shutdown
        fi
end script

Tested out here with gdm and lightdm installed; the dots-over-text error goes away with this change.