Tmux attach: no sessions

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

Suddenly, you can't connect to your tmux session and you don't know why - tmux proccess is still visible in "ps" output.

# tmux attach
no sessions


This one might give you a vague idea that you indeed messed with some files in /tmp:

# strace -e open,connect tmux attach
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libutempter.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
connect(5, {sa_family=AF_LOCAL, sun_path="/tmp/tmux-0/default"}, 110) = -1 ECONNREFUSED (Connection refused)
open("/tmp/tmux-0/default.lock", O_WRONLY|O_CREAT, 0600) = 5
connect(6, {sa_family=AF_LOCAL, sun_path="/tmp/tmux-0/default"}, 110) = -1 ECONNREFUSED (Connection refused)
open(".", O_RDONLY)                     = 5
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6881, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
no sessions
+++ exited with 1 +++


You can send a kill -10 signal to tmux to fix it and be able to attach again:

# killall -10 tmux