summaryrefslogtreecommitdiff
path: root/system/openssh/sshd.initd
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-06-29 19:58:08 +0000
committerZach van Rijn <me@zv.io>2021-06-29 19:58:08 +0000
commit7d973f7f3eca9615f7b66dbcfa174e3517e58c84 (patch)
treeee728d1b463c9f664976ffecb52607629f41f4e7 /system/openssh/sshd.initd
parent607ac46b45782d21cd19ab42993800bfeba3620e (diff)
parent2c8c34fb270ee6c87aae21b94abd11d42eb9d22f (diff)
downloadpackages-7d973f7f3eca9615f7b66dbcfa174e3517e58c84.tar.gz
packages-7d973f7f3eca9615f7b66dbcfa174e3517e58c84.tar.bz2
packages-7d973f7f3eca9615f7b66dbcfa174e3517e58c84.tar.xz
packages-7d973f7f3eca9615f7b66dbcfa174e3517e58c84.zip
Merge branch 'bugfix-sshd-v3' into 'master'
system/openssh: ignore initscript process on shutdown (v3) See merge request adelie/packages!613
Diffstat (limited to 'system/openssh/sshd.initd')
-rwxr-xr-xsystem/openssh/sshd.initd7
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