diff options
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 d1e6e16d4..912d435c9 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() { |