[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#751636: ssh sessions are not cleanly termined on shutdown/restart with systemd



Christoph Anton Mitterer <calestyo@scientia.net> writes:

> I've now also seen the following:
> root@otherHost:~# poweroff 
> Terminated
> You have mail in /var/mail/root
> root@otherHost:~# Connection to otherHost closed by remote host.
> Connection to otherHost closed.
> user@localHost:~$ 

> Which seems even more strange:
> 1st - Something is Terminated (okay at first I'd have guessed this is
> bash on the remote host

> 2nd - "You have mail in /var/mail/root" from the *remote host* is given,
> so bash is still alive, the ssh process there is obviously still alive
> as well... so what's Terminated?

I believe the "Terminated" message is from poweroff itself getting killed,
which bash notices and prints a "Terminated" and then runs its normal
prompt commands.  That results in the mail notification, and then sshd is
killed and you lose the connection.

In other words, this is just the same issue, only there are three
processes that may be killed in some random order instead of two.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: