From a75bc3d4d75a1e8d2122f5d650ae17e56acba7d0 Mon Sep 17 00:00:00 2001 From: Christoph Hummer Date: Mon, 23 Sep 2024 22:16:02 +0200 Subject: [PATCH] Fix for rc.sshd - Remove trailing slash to be sure to grab the correct PIDs --- etc/rc.d/rc.sshd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/rc.d/rc.sshd b/etc/rc.d/rc.sshd index f6a8395bc..f211f6dff 100755 --- a/etc/rc.d/rc.sshd +++ b/etc/rc.d/rc.sshd @@ -26,7 +26,7 @@ sshd_running(){ # get all pids from sshd for pid in $(pgrep -f $SSHD); do # check if a sshd is running on host system - if ! grep -qE '/docker/|/lxc/' /proc/$pid/cgroup; then + if ! grep -qE '/docker|/lxc' /proc/$pid/cgroup; then return 0 fi done @@ -77,7 +77,7 @@ sshd_stop(){ # get all pids from sshd for pid in $(pgrep -f $SSHD); do # make sure to kill only sshd from host system - if ! grep -qE '/docker/|/lxc/' /proc/$pid/cgroup; then + if ! grep -qE '/docker|/lxc' /proc/$pid/cgroup; then kill $pid fi done