On a host where I was attached to a tmux session, the connection was closed after ten minutes of inactivity:

Connection to somewhere.uk closed by remote host.

After logging back in, tmux is no longer running and I cannot reconnect,

$ ls -l /tmp/tmux-35063/default
srw-rw---- 1 gholl users 0 Nov 14 19:27 /tmp/tmux-35063/default=
$ tmux -S /tmp/tmux-35063/default attach
no sessions
$ tmux -S /tmp/tmux-35063/default ls
failed to connect to server: Connection refused
$ lsof | grep [t]mux
$ ps aux | grep [t]mux

It is different from the problems described here or here, because tmux is killed. It is also different from the problem described at tmux session killed when disconnecting from ssh, because when I logout regularly or kill ssh client-side, tmux is still running and I can reconnect. If I disconnect from tmux but remain logged in, tmux does not get killed when I am disconnected. It seems the problem only appears if the connection is closed by the remote host while I am connected to tmux.

What causes this and what may be the solution? May there be a setting that triggers tmux to get killed when the connection is closed by the remote host, but not when I logout gracefully or otherwise close the connection client-side?

The remote machine is a scientific analysis machine running Red Hat Enterprise Linux Server release 6.8 (Santiago) with Linux 2.6.32-642.6.2.el6.x86_64 and OpenSSH_5.3p1, OpenSSL 1.0.1e-fips. The uptime is currently 19 days. It uses init, not systemd. I have no root access so my ability to test different configurations are limited (and this is a production box, so I expect the system administrators may wish to be careful as well).

  • It sounds like the server was rebooted. What's the uptime on the system? Has this happened more than once? – jayhendren Nov 14 '16 at 20:43
  • @jayhendren It happens whenever I'm inactive for ten minutes. Uptime 19 days. – gerrit Nov 14 '16 at 20:44
  • 1
    Hmmm, sounds like the server may be killing the processes of users that have been idle for a while. What happens if you log in, start a tmux session, then disconnect from the session while leaving it running and staying logged in? Is the tmux session killed after 10 minutes of idling? What happens if you log in, start tmux, exit the session while leaving it running, and log off? Is the tmux session still killed after 10 minutes in that scenario? – jayhendren Nov 14 '16 at 20:48
  • @jayhendren I will test that in a moment. I've also asked system support for assistance. – gerrit Nov 14 '16 at 20:52
  • 2
    I suggest contacting your server administrators with this question. I was unable to reproduce the problem on my own. I don't think this has anything to do with tmux. It seems that the server administrators are killing your tmux server for some reason. – jayhendren Nov 14 '16 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.