diff options
author | CyberLeo <cyberleo@cyberleo.net> | 2021-07-22 21:02:46 -0500 |
---|---|---|
committer | CyberLeo <cyberleo@cyberleo.net> | 2021-07-22 21:02:46 -0500 |
commit | 59068642667b2748b2f24d18c58b1d2fdfed7619 (patch) | |
tree | deca4d721637676253ed1270f252f8d389286151 /system/openssh/sshd.initd | |
parent | 4a177049e3d486da3f54d346d63ea80699c08b5b (diff) | |
parent | 50e523c03bbcb6be1298e3dedb0441b7e47ab2eb (diff) | |
download | packages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.gz packages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.bz2 packages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.xz packages-59068642667b2748b2f24d18c58b1d2fdfed7619.zip |
Merge branch 'master' into kpartx
Diffstat (limited to 'system/openssh/sshd.initd')
-rwxr-xr-x | system/openssh/sshd.initd | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/openssh/sshd.initd b/system/openssh/sshd.initd index 065519174..e13924e2c 100755 --- a/system/openssh/sshd.initd +++ b/system/openssh/sshd.initd @@ -82,7 +82,12 @@ stop() { eend $? if [ "$RC_RUNLEVEL" = "shutdown" ]; then - _sshd_pids=$(pgrep "${SSHD_BINARY##*/}") + local _p _sshd_pids + for _p in $(pgrep "${SSHD_BINARY##*/}"); do + [ "$(realpath /proc/$_p/exe)" = "${SSHD_BINARY}" ] \ + || continue + _sshd_pids="$_sshd_pids $_p" + done if [ -n "$_sshd_pids" ]; then ebegin "Shutting down ssh connections" kill -TERM $_sshd_pids >/dev/null 2>&1 |