retitle 751636 ssh sessions are not cleanly terminated on shutdown/restart with systemd stop
Hey. Some updates on this: 1) I recently completely reworked my sshd_config, and since then, when I shutdown the server where sshd runs upon, I do get logouts on the clients that are connected to it. The strange thing though is, that the way the client is logged out differs from time to time. Sometimes it says: Terminated Connection to myhost closed by remote host. Connection to myhost closed. Sometimes just: Connection to myhost closed by remote host. Connection to myhost closed. So it still seems that something is a bit fishy there. 2) I've just experienced another behaviour though I'm not sure whether it's actually systemd related or some other bug in ssh itself. What happened is, that I rebooted the client node and after log in back to the server node, I accidentally noted that the former ssh connected was still running there (since aptitude was run in it, and it hat dpkg locked). This also shows the potential deeper effects of this issue, i.e. apps not working correctly anymore due to locking and similar things. Now I do have TCPKeepAlives disabled, but I have ClientAlive* enabled... so it's just a matter of time till sshd would have killed it,.. nevertheless it's not quite nice the way it is. I just cannot reproduce right now whether this was actually caused by systemd on the client (i.e. networking being stopped, before the ssh process was terminated, and thus no clean disconnection happening) or whether it's some issue in ssh itself. The later could be the case, because I was trying the newest version of needrestart, which suggested detected gdm.service to require a restart, and even though it was not checked, it still killed my Cinnamon session, and with that it should have also killed any gnome-terminal process in it and thus also the ssh. Only after that happened I've rebooted, so it could also be the case that the session was already dead but not cleanly disconnected, long before systemd came into play. Cheers, Chris.
smime.p7s
Description: S/MIME cryptographic signature