diff options
Diffstat (limited to 'main/openssh/sshd.initd')
-rw-r--r-- | main/openssh/sshd.initd | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/main/openssh/sshd.initd b/main/openssh/sshd.initd index 34852c4e31..149b0ecef6 100644 --- a/main/openssh/sshd.initd +++ b/main/openssh/sshd.initd @@ -63,6 +63,7 @@ start() { } stop() { + local rc= if [ "${RC_CMD}" = "restart" ] ; then checkconfig || return 1 fi @@ -70,7 +71,14 @@ stop() { ebegin "Stopping ${SVCNAME}" start-stop-daemon --stop --exec "${SSHD_BINARY}" \ --pidfile "${SSHD_PIDFILE}" --quiet - eend $? + rc=$? + eend $rc + + if [ "${RC_CMD}" = "stop" ]; then + # kill sessions on shutdown but not on restart + killall -q sshd & + fi + return $rc } reload() { |