Skip to content

Commit 8dfa644

Browse files
authored
Merge pull request hestiacp#2850 from manuelserol/main
Update v-list-sys-services
2 parents f5b33c6 + 5c0e11a commit 8dfa644

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/v-list-sys-services

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ get_srv_state() {
9494
if [ -z "$pids" ] && [ "$name" != 'nginx' ]; then
9595
pids=$(pgrep $name |tr '\n' '|')
9696
fi
97+
98+
# Prevent from an SSH false positive when there is a TTY or SFTP connection but service is down
99+
if [ "$name" == 'ssh' ] && [ "$(systemctl show sshd.service | grep 'SubState=' | cut -f2 -d=)" != "running" ]; then
100+
pids=''
101+
fi
97102

98103
# Checking pid
99104
if [ -n "$pids" ]; then

0 commit comments

Comments
 (0)