Skip to content

Commit 18ebaec

Browse files
committed
pidof fallback for service list
1 parent 5dbadaa commit 18ebaec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/v-list-sys-services

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ get_srv_state() {
3131
else
3232
pids=$(pidof -x $proc_name |tr ' ' '|')
3333
fi
34+
if [ -z "$pids" ]; then
35+
#fallback to pgrep
36+
pids=$(pgrep $proc_name |tr '\n' '|')
37+
fi
3438
if [ ! -z "$pids" ]; then
3539
pid=$(echo $pids|cut -f 1 -d \|)
3640
pids=$(egrep "$pids" $tmp_file)

0 commit comments

Comments
 (0)