diff options
author | Matt Smith <mcs@darkregion.net> | 2011-03-31 04:24:08 -0500 |
---|---|---|
committer | Matt Smith <mcs@darkregion.net> | 2011-03-31 07:25:03 -0500 |
commit | bf17c7ead2d220d467c13420815aa19105e805ac (patch) | |
tree | 8a1834685fb24f11d27000e014170d85ae3c6f7d /main/openssh/sshd.initd | |
parent | 7faef200060e1a0e2f098a349bf6c1ea9a7dcb5d (diff) | |
download | aports-bf17c7ead2d220d467c13420815aa19105e805ac.tar.bz2 aports-bf17c7ead2d220d467c13420815aa19105e805ac.tar.xz |
main/openssh: drop connections on reboot/halt
Diffstat (limited to 'main/openssh/sshd.initd')
-rw-r--r-- | main/openssh/sshd.initd | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/openssh/sshd.initd b/main/openssh/sshd.initd index d1e6e16d40..912d435c99 100644 --- a/main/openssh/sshd.initd +++ b/main/openssh/sshd.initd @@ -74,6 +74,13 @@ stop() { start-stop-daemon --stop --exec "${SSHD_BINARY}" \ --pidfile "${SSHD_PIDFILE}" --quiet eend $? + + if [ "$RC_RUNLEVEL" = "shutdown" ]; then + ebegin "Shutting down ssh connections" + _sshd_pids=$(pgrep "${SSHD_BINARY##*/}: .* \[priv]") + kill -TERM $_sshd_pids 2>&1 >/dev/null + eend 0 + fi } reload() { |