Is it possible to detect on the server, when a client disconnects?

hi team,
I really love Thinlinc, it is a great successor of the thin-clients “SunRay” from former Sun-Microsystems. One thing tough I keep having problems with, is the sharing of the client-device local disk towards the server, via NFS, in the server user’s “$HOME/thindrives” directory:
This directory gets nicely mounted initially, when a client connects, with e.g. a Windows-client’s “C:” disk drive being the source.
However when the person on this client disconnects (or simply closes that device), then no proper unmounting is happening of that NFS-mounted local device disk: on the VSM agent, I see with “mount -vt nfs” that the “C:” disk from that initial client is still mounted on the agent after the client disconnected.

localhost:@otp:01517d904c9020dc2dc41c26d2ac0759/c/TEMP on /var/opt/thinlinc/sessions/thisuser/10/drives/TEMP type nfs (rw,nosuid,nodev,noexec,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,acregmin=2,acregmax=2,acdirmin=2,acdirmax=2,soft,nolock,proto=tcp,port=5004,timeo=50,retrans=1,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountport=5004,mountproto=tcp,local_lock=all,addr=127.0.0.1)

Reconnecting later with the same user to the same VSM agent, but from another client device, is not mounting that other client device’s local disk drive “D:”

→ is it possible to capture somehow when a client device disconnected, and then run explicitly the “tl-umount-drives [-s]” ?
→ is it possible to change one the scripts which deals with a re-connect (start of tlclient) to make it run “tl-mount-drives” ?

Hi @langhha, welcome to the forum!

You could potentially use scripts in /opt/thinlinc/etc/sessionreconnect.d to achieve this. NFS is a bit fussy, so you’d definitely have to unmount/remount if connecting from a different client. Let us know if this works for you.

thx Aaron, however the “tl-umount-drives” and “tl-mount-drives” are scripts that must be run on a VSM-agent, and running by the user account which is disconnecting or reconnecting.
According to the documentation, any script in “/opt/thinlinc/etc/sessionreconnect.d” are being executed by “root” on the VSM-server, not on the agent…

Is there any alternative way to have scripts executing on the VSM-agent instead, and by the connecting user (not a “root”) ?

You’re right, sorry. I assumed you were running agent and master on the same machine.

I can’t think of any way to do this automatically I’m afraid. The mounting/unmounting of local drives only happens when the session is started/ended, not during disconnect/reconnect.

It is expected behaviour that the local NFS mount remains even when the client has disconnected, but if a client re-connects with different exported paths, then it will need to be remounted using tl-umount-localdrives followed by tl-mount-localdrives. One idea might be to write a short script to do this, with an icon on the desktop. Users can then click on the icon to remount their local drives when reconnecting from a different client.

Hope that helps!