summaryrefslogtreecommitdiff
path: root/testing/openssh/sshd.close-sessions
blob: 208583238e72a62e5f1e9883f92781eb2755d114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Close sshd sessions before shutting down the network; see FS#17389.

sshd_close_sessions () {
	/etc/rc.d/sshd stop
	stat_busy "Stopping Secure Shell Sessions"
	for i in $(pgrep sshd); do
		if readlink -q /proc/$i/exe &>/dev/null | grep -q '^/usr/sbin/sshd'; then
			kill $i &>/dev/null
		fi
	done
	stat_done
}

add_hook shutdown_start sshd_close_sessions