summaryrefslogtreecommitdiffstats
path: root/abs/core/openssh/sshd.close-sessions
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/openssh/sshd.close-sessions')
-rw-r--r--abs/core/openssh/sshd.close-sessions17
1 files changed, 17 insertions, 0 deletions
diff --git a/abs/core/openssh/sshd.close-sessions b/abs/core/openssh/sshd.close-sessions
new file mode 100644
index 0000000..be2a709
--- /dev/null
+++ b/abs/core/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