diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/service/util/serviceutil.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/service/util/serviceutil.sh b/src/service/util/serviceutil.sh index c4d9efd..d8c65fd 100755 --- a/src/service/util/serviceutil.sh +++ b/src/service/util/serviceutil.sh @@ -43,7 +43,12 @@ then echo "stopped" # TODO - should be failed and propagated to the state property else pid=`echo "$output" | sed -n -e 's/^[ \t]\+Main PID:[ \t]\+\([0-9]\+\).*/\1/p'` - echo "$pid $2" + if [ "$pid" == "" ]; then + # Some service don't have Main PID (e.g. iptables), report as PID 1 + echo "1 $2" + else + echo "$pid $2" + fi fi ;; *) |