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

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



Hey,

OK looking at this bug, if I understood the issue properly, I think I
found what the problem is.

With libpam-systemd installed, UsePAM set to yes, the ssh process with
lower privileges is assign to the user session, when shutting down,
systemd is going through all the user sessions and kill them one by one
properly.

Without libpam-systemd (or UsePAM set to no), the low privileged process
stays in the sshd cgroup. As the ssh.service file explicitly contains
KillMode=process, only the main (privileged) process is killed. At the
end of the shutdown procedure, systemd is going into a killing spree
and SIGKILL all the remaining processes.

The correct solution is IMVHO is to use libpam-systemd with UsePAM set
to yes. On other solution is to change the KillMode, but doing so,
you'll probably loose the connection if the ssh service is restarted.

my 2¢

Laurent Bigonville


Reply to: