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 via email to