Bug 6109 - xlogout.d not executed when pressing cancel in profile selection dialog
Summary: xlogout.d not executed when pressing cancel in profile selection dialog
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Agent (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: MediumPrio
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-14 15:35 CET by Peter Åstrand
Modified: 2016-12-27 10:13 CET (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments
xinit.log when pressing cancel at profile selection (4.13 KB, text/x-log)
2016-12-14 15:36 CET, Peter Åstrand
Details

Description Peter Åstrand cendio 2016-12-14 15:35:19 CET
On my workstation at home, xlogout.d is not always executed. I've seen problems on multiple occasions, but this last time, I had one session active, started another one, then pressed Cancel at the profile selection dialog. In this case, it took many seconds until tl-session terminated. This turned out to be due to NFS timeouts:

tl-xinit: cannot stat ../1.1481102364.ended/drives/e: Stale file handle
tl-xinit: Could not remove ../1.1481102364.ended. Stray files may remain.

This, in turn, is because tl-umount-localdrives was not executed since nothing at all in xlogout.d was executed. The last part of xinit.log is:

Running /opt/thinlinc/etc/xstartup.d/12-tl-default-keyboard (Configuring default keyboard layout)
Setting default keyboard layout to "us"
Running /opt/thinlinc/etc/xstartup.d/20-tl-select-profile.sh (Choosing a profile)
/opt/thinlinc/libexec/tl-select-profile: user aborted profile selection
tl-xinit: client terminated and returned 0
XIO:  fatal IO error 11 (Resursen tillfälligt otillgänglig) on X server ":2"
      after 2519 requests (2447 known processed) with 0 events remaining.
tl-run-xstartup-feedback: Fatal IO error 11 (Resursen tillfälligt otillgänglig) on X server :2.
tl-xinit: deleting ../1.1481103580.ended
tl-xinit: deleting ../1.1481102364.ended
tl-xinit: cannot stat ../1.1481102364.ended/drives/e: Stale file handle
tl-xinit: Could not remove ../1.1481102364.ended. Stray files may remain.
tl-xinit: deleting ../1.1480932617.ended
tl-xinit: cannot stat ../1.1480932617.ended/drives/e: Stale file handle
tl-xinit: Could not remove ../1.1480932617.ended. Stray files may remain.
tl-xinit: Session terminated. Exiting.
Comment 1 Peter Åstrand cendio 2016-12-14 15:36:42 CET
Created attachment 763 [details]
xinit.log when pressing cancel at profile selection
Comment 2 Peter Åstrand cendio 2016-12-14 16:17:10 CET
Investigated this some more. The problem is that xlogout.d is not executed if you press cancel in the profile selection dialog. This problem was not introduced in 4.7.0; it's been around a very long time.

It could be argued that this is a desired behaviour, but in that case, it should probably be much clearer that scripts in xstartup.d with numbers < 20 are not executed if pressing cancel. (If I remember correctly, before tl-select-profile invocation was moved to xstartup.d, nothing in xstartup.d at all was executed upon cancel, which is somewhat more intuitive.
Comment 3 Thomas Nilefalk cendio 2016-12-20 10:51:23 CET
We need more info on the effects of this problem and how often it happens etc.
Comment 4 Peter Åstrand cendio 2016-12-21 12:25:18 CET
(In reply to comment #3)
> We need more info on the effects of this problem and how often it happens etc.

It happens every time, but the impact is low on a standard installation, which has:

00-tl-pulseaudio-env.sh
01-tl-kinit.sh
02-tl-dbus-launch.sh
11-tl-set-title
12-tl-default-keyboard
20-tl-select-profile.sh

None of these files does anything that requires a cleanup, AFAICT. 

We could clarify the documentation, but I guess it's already technically correct:
https://www.cendio.com/resources/docs/tag/configuration_customizing_user_session.html:'

"When the commands run by tl-run-profile exits, xstartup.default runs the command tl-run-xlogout.d which runs scripts and commands located in the directory /opt/thinlinc/etc/xlogout.d."

If you press cancel, tl-run-profile will not execute at all, which implies that xlogout.d is not executed. 

Perhaps good enough.

Note You need to log in before you can comment on or make changes to this bug.