I am using tmux to create a shared session in /tmp called tekkit.
All works fine, with one major exception. When the tmux session is closed, the /tmp/tekkit socket file remains in place. This is a big issue, as now nobody, besides the owner of that socket file can start this session again
Running the command: tmux -S /tmp/tekkit new -d sh TekkitLaunch.sh
Presents all other users with: error connecting to /tmp/tekkit (Operation not permitted)
All users are part of the same group, and have full rwx permissions on the socket file.
Normally, I’d unlink the socket file after closing the session, however that also doesn’t work, as only the file owner can unlink it. All other users, even tho they have the necessary permissions to do so, cannot unlink it and are presented with this error: unlink: cannot unlink '/tmp/tekkit': Operation not permitted
I am unlinking the file like so: unlink /tmp/tekkit
My questions are:
What am I doing wrong and how do I either:
A) Let the socket file stay as it is but be able to start a new session with another user after the first session is closed.
B) Unlink the socket file with other users than the file owner.
Both solutions need to work without super-user access!
Thank You for Your help.
/tmp
has a sticky bit enabled that prevents users other than the owner from deleting the file. – Ginnungagap Aug 13 '23 at 20:49