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

Bug#751636: script to gracefully kill ssh user session on reboot only



hello,

to follow up message #20, this is the unit I use:

# cat >/etc/systemd/system/kill-ssh-user-sessions-on-shutdown.service <<EOF
[Unit]
Description=Shutdown all ssh sessions before network
DefaultDependencies=no
Before=network.target shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/bin/killall sshd

[Install]
WantedBy=poweroff.target halt.target reboot.target
EOF

# systemctl enable kill-ssh-user-sessions-on-shutdown

this allow me to reboot or poweroff the system without the ssh user session being stuck
FYI, installing libpam-systemd doesn't solve the problem for me

best regards,

--
*Jephté CLAIN | Développeur, Intégrateur d'applications*
Service Systèmes d'Information
Direction des Systèmes d'Information <http://numerique.univ-reunion.fr>
Tél: +262 262 93 86 31 <tel:+262262938631> || Gsm: +262 692 29 58 24 <tel:+262692295824> www.univ-reunion.fr <http://www.univ-reunion.fr> || Facebook <http://www.facebook.com/pages/Universit%C3%A9-de-La-R%C3%A9union-OFFICIEL/197176816990430> || Twitter <http://twitter.com/univ_reunion>


Reply to: