summaryrefslogtreecommitdiffstats
path: root/main/openssh/sshd.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-10-21 09:22:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-10-21 09:22:55 +0000
commit4a7fde37aaf32ca55527bd2b0207c617b3996c4b (patch)
tree3b8509e98cdedb7a01afaf7644979bcca3d86761 /main/openssh/sshd.initd
parent324acb3452a5bfa16e711ef0b22be938f2c8cba8 (diff)
downloadaports-4a7fde37aaf32ca55527bd2b0207c617b3996c4b.tar.bz2
aports-4a7fde37aaf32ca55527bd2b0207c617b3996c4b.tar.xz
main/openssh: do not try kill nonexisting sshd session on shutdown
Fixes the error message on shutdown: sh: you need to specify whom to kill
Diffstat (limited to 'main/openssh/sshd.initd')
-rw-r--r--main/openssh/sshd.initd4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/openssh/sshd.initd b/main/openssh/sshd.initd
index 912d435c9..35430c5e4 100644
--- a/main/openssh/sshd.initd
+++ b/main/openssh/sshd.initd
@@ -78,7 +78,9 @@ stop() {
if [ "$RC_RUNLEVEL" = "shutdown" ]; then
ebegin "Shutting down ssh connections"
_sshd_pids=$(pgrep "${SSHD_BINARY##*/}: .* \[priv]")
- kill -TERM $_sshd_pids 2>&1 >/dev/null
+ if [ -n "$_sshd_pids" ]; then
+ kill -TERM $_sshd_pids >/dev/null 2>&1
+ fi
eend 0
fi
}