1

I have no idea what happened here but i deleted /tmp/ and now all my tmux sessions are gone, but for some weird reason the processes that used to be attached to these sessions are still running in the background, now, I made a while true do; script in these sessions to run a process forever, and the reason why I cannot kill the processes, I tried getting the process outputs at /proc/ but it's not outputting there, I bet tmux redirected the outputs on its own, how do i go around this?

1
  • 2
    Did you delete /tmp/ itself? Or just the content? Commented Jun 27 at 13:11

1 Answer 1

3

You cannot communicate with the tmux server because you have removed the socket where the server was listening. I assume the socket was in the default location.

If you somehow have managed to start a new tmux server and it is probably using the same default path for its socket, then the new server is in the way. Terminate the new tmux server then; we want only the old tmux server to stay, the one that you have lost contact with. Other users' tmux servers are not in the way.

Run tmux ls. If it cannot communicate with any tmux server then it will tell you something like

error connecting to /tmp/tmux-1000/default (No such file or directory)

(where the actual path may differ; adjust the solution accordingly).

man 1 tmux states:

If the socket is accidentally removed, the SIGUSR1 signal may be sent to the tmux server process to recreate it (note that this will fail if any parent directories are missing).

So in general you need to re-create the directory (directiories):

mkdir -m 700 -p /tmp/tmux-1000/

Then send SIGUSR1 to the tmux server to make it recreate the socket. The following command will send SIGUSR1 to all your tmux processes. It's OK: tmux clients (if any) will ignore it and the tmux server will do what we want.

pkill --signal USR1 tmux

A new socket should be created and from now on tmux whatever should work. Attach to your sessions and continue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .