ajouter un service pour tuer les sessions ssh lors de l'arrêt de la machine
This commit is contained in:
parent
4e1e5a44ca
commit
c95d1cd39a
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||||
|
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
|
||||||
|
urequire DEFAULTS
|
||||||
|
|
||||||
|
run_as_root "$@"
|
||||||
|
cp "$scriptdir/kill-ssh-user-sessions.service" /etc/systemd/system
|
||||||
|
systemctl enable kill-ssh-user-sessions.service
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||||
. "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
|
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
|
||||||
urequire DEFAULTS
|
urequire DEFAULTS
|
||||||
|
|
||||||
check_sysinfos -s linux -d debian || exit 0
|
check_sysinfos -s linux -d debian || exit 0
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||||
. "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
|
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
|
||||||
urequire DEFAULTS
|
urequire DEFAULTS
|
||||||
|
|
||||||
check_sysinfos -s linux -d debian || exit 0
|
check_sysinfos -s linux -d debian || exit 0
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Shutdown all ssh sessions before network
|
||||||
|
DefaultDependencies=no
|
||||||
|
Before=network.target shutdown.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/sh -c "/usr/bin/killall sshd;:"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=poweroff.target halt.target reboot.target
|
Loading…
Reference in New Issue