regression with session-cleanup-script triggering without actual logins

Bug #1249515 reported by Jason Unovitch
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Light Display Manager
New
Undecided
Unassigned
lightdm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description:
In Ubuntu 13.10, session-cleanup scripts trigger before a session has started. Simply clicking between users at the login menu triggers the session cleanup script. In my particular configuration this triggers a logout script that runs rsync with the --delete flag. Clicking between users runs the risk of deleting good files rather than doing backups as in prior releases so I can't update all my computers until fixed. The example below replicates and visually shows the effect. While running, the user cannot login until it has completed and depending on what the logout script does it can cause problems.

Configuration to Replicate:
/etc/lightdm/lightdm.conf
session-setup-script = /usr/bin/gnome-terminal --command "/bin/sleep 10"
session-cleanup-script = /usr/bin/gnome-terminal --command "/bin/sleep 10"

Version Information:
`lsb_release -rd`
Description: Ubuntu 13.10
Release: 13.10

`apt-cache policy lightdm`
lightdm:
  Installed: 1.8.4-0ubuntu1
  Candidate: 1.8.4-0ubuntu1
  Version table:
 *** 1.8.4-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ saucy-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.2-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages

Log information (while clicking between users at login screen):
`cat /var/log/lightdm/lightdm.log`
[+825.63s] DEBUG: Session pid=8564: Greeter start authentication for nixadm
[+825.63s] DEBUG: Session pid=12697: Sending SIGTERM
[+825.63s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+825.63s] DEBUG: Session: Setting XDG_VTNR=7
[+825.63s] DEBUG: Session pid=29773: Started with service 'lightdm', username 'nixadm'
[+825.63s] DEBUG: Session pid=12697: Terminated with signal 15
[+825.63s] DEBUG: Session: Failed during authentication
[+825.63s] DEBUG: Seat: Session stopped
[+825.64s] DEBUG: Launching process 29780: /usr/bin/gnome-terminal --command "/bin/sleep 10"
[+835.82s] DEBUG: Process 29780 exited with return value 0
[+835.82s] DEBUG: Seat: Exit status of /usr/bin/gnome-terminal --command "/bin/sleep 10": 0
[+835.82s] DEBUG: Session pid=29773: Got 1 message(s) from PAM
[+835.82s] DEBUG: Session pid=8564: Prompt greeter with 1 message(s)
[+836.30s] DEBUG: Session pid=8564: Greeter start authentication for jason
[+836.30s] DEBUG: Session pid=29773: Sending SIGTERM
[+836.30s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+836.30s] DEBUG: Session: Setting XDG_VTNR=7
[+836.31s] DEBUG: Session pid=29790: Started with service 'lightdm', username 'jason'
[+836.31s] DEBUG: Session pid=29773: Terminated with signal 15
[+836.31s] DEBUG: Session: Failed during authentication
[+836.31s] DEBUG: Seat: Session stopped
[+836.32s] DEBUG: Launching process 29797: /usr/bin/gnome-terminal --command "/bin/sleep 10"
[+846.47s] DEBUG: Process 29797 exited with return value 0
[+846.47s] DEBUG: Seat: Exit status of /usr/bin/gnome-terminal --command "/bin/sleep 10": 0
[+846.47s] DEBUG: Session pid=29790: Got 1 message(s) from PAM
[+846.47s] DEBUG: Session pid=8564: Prompt greeter with 1 message(s)
[+846.92s] DEBUG: Session pid=8564: Greeter start authentication for nixadm
[+846.92s] DEBUG: Session pid=29790: Sending SIGTERM
[+846.92s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+846.92s] DEBUG: Session: Setting XDG_VTNR=7
[+846.92s] DEBUG: Session pid=30421: Started with service 'lightdm', username 'nixadm'
[+846.93s] DEBUG: Session pid=29790: Terminated with signal 15
[+846.93s] DEBUG: Session: Failed during authentication
[+846.93s] DEBUG: Seat: Session stopped
[+846.94s] DEBUG: Launching process 30428: /usr/bin/gnome-terminal --command "/bin/sleep 10"
[+857.08s] DEBUG: Process 30428 exited with return value 0
[+857.08s] DEBUG: Seat: Exit status of /usr/bin/gnome-terminal --command "/bin/sleep 10": 0
[+857.08s] DEBUG: Session pid=30421: Got 1 message(s) from PAM
[+857.08s] DEBUG: Session pid=8564: Prompt greeter with 1 message(s)
[+857.60s] DEBUG: Session pid=8564: Greeter start authentication for jason
[+857.60s] DEBUG: Session pid=30421: Sending SIGTERM
[+857.61s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+857.61s] DEBUG: Session: Setting XDG_VTNR=7
[+857.61s] DEBUG: Session pid=30437: Started with service 'lightdm', username 'jason'
[+857.61s] DEBUG: Session pid=30421: Terminated with signal 15
[+857.61s] DEBUG: Session: Failed during authentication
[+857.61s] DEBUG: Seat: Session stopped
[+857.63s] DEBUG: Launching process 30444: /usr/bin/gnome-terminal --command "/bin/sleep 10"
[+867.77s] DEBUG: Process 30444 exited with return value 0
[+867.77s] DEBUG: Seat: Exit status of /usr/bin/gnome-terminal --command "/bin/sleep 10": 0
[+867.77s] DEBUG: Session pid=30437: Got 1 message(s) from PAM
[+867.77s] DEBUG: Session pid=8564: Prompt greeter with 1 message(s)

Tags: patch
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
Revision history for this message
Mike Forester (icerider) wrote :

This bug appeared from revision: http://bazaar.launchpad.net/~lightdm-team/lightdm/1.8/revision/1716 lightdm-1.7.5

Revision history for this message
Mike Forester (icerider) wrote :

Might add the check on authentification for fix launch session-cleanup-script.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lightdm-1.8.5-cleanup-script.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

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

I'm also seeing this in Trusty (lightdm 1.10.1-0ubuntu1). At our site, we have a custom greeter using the GIR bindings, and calling .cancel_authentication() causes the session-cleanup script to run. As this is designed to, you know, clean up after a session, it is not idempotent and is not designed to be run without the corresponding session-setup script having run. Obviously we can workaround this, but seeing as how this was a pretty serious regression, is there any hope of this getting fixed?

Revision history for this message
Borim (borim) wrote :

Also in Ubuntu 14.04 this bug exists, too. The configured script run during the boot process before the login window is visible. That is too early for my script and the execution fails. As the result lightdm never starts and the login screen is never visible. The deadlock can only be left, by switching into the console and remove the session cleanup script.

My expectation is that the cleanup script runs only when I logout from a session. Also a failure in the cleanup script should not prevent starting or stopping lightdm.

Revision history for this message
Borim (borim) wrote :

My problem was caused by a broken lightdm.conf
After fixing the configuration file the session-cleanup-script works as intended. Thats why I mark this bug as Fix Released.

Changed in lightdm (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Luke Faraone (lfaraone) wrote : Re: [Bug 1249515] Re: regression with session-cleanup-script triggering without actual logins

On 17 August 2014 03:46, Borim <email address hidden> wrote:
> My problem was caused by a broken lightdm.conf
> After fixing the configuration file the session-cleanup-script works as intended. Thats why I mark this bug as Fix Released.

This issue is still affecting other users, and isn't obviously caused by an issue in the lightdm.conf. Would you care to elaborate here?

 status confirmed

Revision history for this message
Anders Kaseorg (andersk) wrote :

Excuse me. You do not get to close somebody else’s bug just because you found a workaround. The problem is still reproducible on Utopic as described. Please reopen this.

Luke Faraone (lfaraone)
Changed in lightdm (Ubuntu):
status: Fix Released → 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.