From 18ebaec8579ee733d15d46bf8f8457a52c30ee20 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 29 May 2015 01:51:25 +0300 Subject: [PATCH] pidof fallback for service list --- bin/v-list-sys-services | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services index b49e5bcb..77ed0650 100755 --- a/bin/v-list-sys-services +++ b/bin/v-list-sys-services @@ -31,6 +31,10 @@ get_srv_state() { else pids=$(pidof -x $proc_name |tr ' ' '|') fi + if [ -z "$pids" ]; then + #fallback to pgrep + pids=$(pgrep $proc_name |tr '\n' '|') + fi if [ ! -z "$pids" ]; then pid=$(echo $pids|cut -f 1 -d \|) pids=$(egrep "$pids" $tmp_file)