Move some cleanup stuff after X terminates

Bug #1093144 reported by Alkis Georgopoulos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP5
Fix Released
Medium
Alkis Georgopoulos
ltsp (Debian)
Fix Released
Unknown

Bug Description

Most of the things in ltsp-trunk/client/localapps/ldm-rc.d/X99-zlocalapps-cleanup should happen after X is terminated, for 2 reasons:
 * When the X9* scripts run, X is still running, along with many local user processes, so for example ~/.gvfs is still in use, and `fusermount -uqz ${LDM_HOME}` fails. That results in many problems when fat client or localapps users log in for a second time.
 * In case X crashes, these script won't get to run at all, so it'd be safer to do the cleanup from a process that isn't killed when X dies (so not from within ldm).

That's what X99-ltsp-logout-action is trying to do too: it postpones the reboot/shutdown action for after X termination, to be processed by XS00-halt-reboot. It would make more sense if all those evens run on the "stop" event of ldm-script, but unfortunately currently the "stop" event happens while X is still running, so it's not different from the X9* scripts.
I think it'd be better if the "stop" event was launched after X terminates. Maybe some screen-session.d/XK00-* script could launch it.
Btw X99-zzz-logout-action should be deleted, its functionality has been moved to X99-ltsp-logout-action.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix committed mostly in http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/2429 and in http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ldm-trunk/revision/1458.

Importance set to medium as there was a possibility for data loss:
 * User logs in, using a fat client or localapps,
 * Then logs out,
 * fusermount -uqz forcibly unmounts "$LDM_HOME",
 * User processes that are still running write back their data *locally* in the tmpfs "$LDM_HOME",
 * And in the next login of the same user, sshfs refuses to mount "$LDM_HOME" because "nonempty" wasn't set, so the user can't see his documents/settings, and any new documents he creates are lost on logout.

Changed in ltsp:
assignee: nobody → Alkis Georgopoulos (alkisg)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

It's still not fixed, as the ssh socket is closed by LDM too early, before the `fusermount -u` call.

For a real solution, I propose that LDM runs outside X.
Due to a lack of .C maintainers, I also propose that LDM is rewritten in shell. There were some objections for that, though. And hopefully we'll switch to LightDM in a couple of years and LDM will be deprecated.

So until the problem is solved correctly, I'll implement a hack in shell that forcibly kills all user processes on logout and does the cleanup before X dies.

Changed in ltsp:
assignee: Alkis Georgopoulos (alkisg) → nobody
status: Fix Committed → In Progress
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

The plan to move LDM outside of X was abandoned due to the move to LightDM.
A script that kills all local user processes on logout was committed instead, in
http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/2462.
It's highly suggested that distros affected by this bug, backport that commit,
and of course users can manually apply it if their distros won't backport it.

Changed in ltsp:
assignee: nobody → Alkis Georgopoulos (alkisg)
status: In Progress → Fix Committed
Changed in ltsp (Debian):
status: Unknown → Confirmed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :
Changed in ltsp:
status: Fix Committed → Fix Released
Changed in ltsp (Debian):
status: Confirmed → Fix Released
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.