diff options
author | root <root@rshg054.dnsready.net> | 2012-06-11 00:02:18 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-06-11 00:02:18 +0000 |
commit | 4714cec7e8367a7618b168d0db4bc085dbfaac8a (patch) | |
tree | b1f3049ee78988b0db6ec69637a1ee37c8b63b3f /staging/openssh/sshd.close-sessions | |
parent | 7b2739f21a7ed0d52497fa381c9a2383e71ab7a8 (diff) |
Mon Jun 11 00:02:18 UTC 2012
Diffstat (limited to 'staging/openssh/sshd.close-sessions')
-rw-r--r-- | staging/openssh/sshd.close-sessions | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/staging/openssh/sshd.close-sessions b/staging/openssh/sshd.close-sessions new file mode 100644 index 000000000..be2a709fc --- /dev/null +++ b/staging/openssh/sshd.close-sessions @@ -0,0 +1,17 @@ +# Close sshd sessions before shutting down the network; see FS#17389. + +sshd_close_sessions () { + if ck_daemon sshd; then + return + fi + /etc/rc.d/sshd stop + stat_busy "Stopping Secure Shell Sessions" + for i in $(pgrep sshd); do + if readlink -q /proc/$i/exe | grep -q '^/usr/sbin/sshd'; then + kill $i + fi + done &>/dev/null + stat_done +} + +add_hook shutdown_start sshd_close_sessions |