Bug 5057 - tl-xinit doesn't wait for the client command on termination
Summary: tl-xinit doesn't wait for the client command on termination
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Agent (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.7.0
Assignee: Henrik Andersson
URL:
Keywords: ossman_tester, prosaic
Depends on:
Blocks:
 
Reported: 2014-03-31 13:45 CEST by Pierre Ossman
Modified: 2016-09-23 10:15 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2014-03-31 13:45:42 CEST
This is most noticeable when you do "end existing session". What happens is:

 - The client sends "kill session" to vsmmaster

 - vsmmaster sends "terminate session" to vsmagent

 - vsmagent sends SIGTERM to tl-session

 - tl-session sends SIGTERM to tl-xinit, then waits for it to terminate

 - tl-xinit sends SIGHUP to the client command (normally xsession) and all children, and SIGTERM/SIGKILL to Xvnc.

 - tl-xinit fiddles with the session directory and terminates

Here there is a race between client programs to finish cleanup, and tl-xinit renaming the session directory and terminating. It also means we return success back to the client before everything has died. This can cause conflicts for programs that don't like multiple instances. It also makes the process tree slightly more confusing in the event that the client program refuses to terminate.
Comment 1 Pierre Ossman cendio 2014-03-31 13:50:33 CEST
One noticeable effect of this is stray local drives as it will look for mount points in e.g.

    /var/opt/thinlinc/sessions/user/1/drives

not:

    /var/opt/thinlinc/sessions/user/1.ended/drives
Comment 2 Henrik Andersson cendio 2016-09-09 10:23:32 CEST
The fix for bug #5696 includes changes at this area of how client process is shutdown is handled. It does no wait for client and if timeout is reached the client process will receive a KILL signal.

This change was made in commit r31686 which will solve this bug.
Comment 3 Pierre Ossman cendio 2016-09-15 15:07:06 CEST
Works well. Verified by adding a script with a delay of 5 seconds to xlogout.d. With 4.6.0 we get a race and stray mounts, whilst the nightly build properly cleans up.

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