please stop greeter gracefully when stopping a display server

Bug #1410584 reported by Ryan Tandy
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-greeter (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Dear maintainer,

When lightdm is stopped or restarted, unity-greeter does not get a chance to run its cleanup code, but simply aborts due to the X server going away. Most of the greeter session components die the same way, but the session upstart does not. It keeps running and attempting to respawn services, which results in these few processes and the logind session staying around.

I'm not sure whether this bug belongs properly to lightdm or unity-greeter. It's possible the greeter should react more gracefully when the X server vanishes. I'm filing this against lightdm right now because I feel like all the necessary code for this already exists, it just needs to be called in the right order at the right time. Maybe it just needs to wait for the sessions attached to a particular display server to finish before stopping that server.

Thanks.

Revision history for this message
Ryan Tandy (rtandy) wrote :

A similar thing happens when you switch to a second user, and then switch back to the original user. In this case the greeter actually is sent SIGTERM, but the display server is stopped soon after, before the cleanup has finished.

lightdm.log says:

[+43.64s] DEBUG: Seat seat0: Returning to existing user session userone
[+43.64s] DEBUG: Unlocking login1 session c8
[+43.64s] DEBUG: Activating VT 7
[+43.64s] WARNING: Error using VT_WAITACTIVE 7 on /dev/console: Interrupted system call
[+43.64s] DEBUG: Seat seat0: Stopping greeter
[+43.64s] DEBUG: Session pid=4468: Sending SIGTERM
[+43.64s] DEBUG: Activating login1 session c8
[+43.64s] DEBUG: Session pid=4993: Exited with return value 0
[+43.64s] DEBUG: Seat seat0: Session stopped
[+43.66s] DEBUG: Session pid=4468: Exited with return value 0
[+43.66s] DEBUG: Seat seat0: Session stopped
[+43.66s] DEBUG: Seat seat0: Stopping display server, no sessions require it
[+43.66s] DEBUG: Sending signal 15 to process 4463
[+43.81s] DEBUG: Seat seat0 changes active session to c8
[+43.92s] DEBUG: Process 4463 exited with return value 0
[+43.92s] DEBUG: DisplayServer x-1: X server stopped
[+43.92s] DEBUG: Releasing VT 8
[+43.92s] DEBUG: DisplayServer x-1: Removing X server authority /var/run/lightdm/root/:1
[+43.92s] DEBUG: Seat seat0: Display server stopped

and x-1-greeter.log says:

[+22.94s] DEBUG: unity-greeter.vala:605: Got a SIGTERM
[+22.94s] DEBUG: settings-daemon.vala:78: Failed to acquire name org.gnome.SessionManager
[+22.94s] DEBUG: settings-daemon.vala:105: Failed to acquire name org.gnome.ScreenSaver
[+22.94s] DEBUG: unity-greeter.vala:135: Failed to acquire name com.canonical.Unity
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
upstart: indicator-sound main process ended, respawning
upstart: indicator-keyboard main process ended, respawning
upstart: indicator-power main process ended, respawning
[...]

Note the SIGTERM handler is hit, but "Cleaning up" after the end of the main loop is not.

After that second display server has been shut down, its session upstart and some indicator processes are still running.

summary: - please stop greeter gracefully when stopping lightdm
+ please stop greeter gracefully when stopping a display server
Revision history for this message
Robert Ancell (robert-ancell) wrote :

LightDM does send SIGTERM to a greeter and waits for it to exit.

From your log:
[+43.64s] DEBUG: Session pid=4468: Sending SIGTERM
[+43.66s] DEBUG: Session pid=4468: Exited with return value 0

So if cleanup is not being done it seems likely that unity-greeter is not doing it.

affects: lightdm (Ubuntu) → unity-greeter (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity-greeter (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.