Centos – Tmux on CentOS 7: error connecting to /tmp/tmux-1000/default (No such file or directory)

centostmux

Every time I detach from all the tmux sessions in the terminal, after I want to get back, I get this:

[me@CentOS7 ~]$ tmux ls
error connecting to /tmp/tmux-1000/default (No such file or directory)

It seems the /tmp directory get cleared in the meantime. It doesn't happen straight away and it's hard to tell when exactly but usually after a couple of days of running I know I can't detach in order not to lose the session.

Anyone knows how to retain the session? Prevent CentOS from removing the tmux server somehow? (I assume it's CentOS as it never happened to me on Debian-based distros.)

Best Answer

You can attempt to send a SIGUSR1 to the process in order for the tmux server to recreate the socket

pkill -USR1 tmux

Source

Related Question