-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mosh should disconnect when remote is rebooted #480
Comments
Generally speaking, Mosh already does this (just tested with a Debian server). if it's not working for you, please make sure that your server is sending the kill signal to all processes (including your mosh-servers) before cutting the network. (Also let us know the OS of your server.) |
It did not worked for me on Gentoo (both server and client) with mosh 1.2.4 while it worked with ssh. |
You'll have to take this up with Gentoo -- it needs to send a kill signal (like SIGTERM) to all processes before cutting networking. That's how mosh-server knows it needs to quit. |
Sorry for late reply. I have been thought about it a bit and I guess problem should occur at least on all systemd+netctl systems and probably on systemd+NetworkManager (which are probably all Linux distributions but Debian/Ubuntu currently - and Debian's folks talking about moving to Upstart or systemd). As far as I can tell the correct signal is SIGHUP:
Which is sent by systemd but is ignored by the mosh. |
LSB (ISO/IEC 23360) requires that shutdown (and shutdown -r) send SIGTERM, not SIGHUP. We can patch mosh-server to work around this, but please take this up with systemd. And please submit a pull request -- we'd be eager to merge it if systemd is moving in this direction. |
(Sorry - I realized I spoke too soon. sshd reacts to SIGHUP while mosh does not but it's not the issue). After a thought - the ssh displays a message about shutting down while mosh does not. It looks like mosh is terminating uncleanly and too soon (I guess?). Yay for debugging shutdown issues. I'll investigate further. |
I just tested this on a fresh install of Debian 9 (aka Debian Stretch), which defaults to using systemd these days, as well as my gentoo machine. In both cases, the mosh-client exited cleanly, with no need to manually terminate anything. So now that this appears fixed, I'm going to close this issue. |
I have made a couple of changes over time that should cause (There are still occasionally systems that bring down their network connectivity before user sessions are closed. That is a different problem which should be addressed at the OS/configuration level.) |
When I use ssh and reboot remote a message displaying that remote is rebooted is displayed and ssh session is terminated. mosh needs to be terminated manually.
It would be nice to send the disconnection signal to client when server is being terminated.
The text was updated successfully, but these errors were encountered: