Updated status_of_proc to properly deal with stopped process that uses pidfile
This commit is contained in:
2
Makefile
2
Makefile
@@ -18,7 +18,7 @@ DESC = This package supplies the core required init scripts for startup
|
||||
ARCHIVE := ''
|
||||
SRCDIR := $(PWD)/SRC/initscripts
|
||||
PATCHDIR := $(PWD)/SRC/patches
|
||||
VERSION := 1.11-0
|
||||
VERSION := 1.12-0
|
||||
|
||||
include /usr/share/snap/Makefile.snaplinux
|
||||
|
||||
|
||||
@@ -213,25 +213,26 @@ status_of_proc() {
|
||||
echo "$NAME is not running" && return 1
|
||||
fi
|
||||
else
|
||||
echo "Cannot read pid file ($pidfile)"
|
||||
|
||||
pid=$(pidofproc "$pathname")
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "Cannot read pid file ($pidfile)"
|
||||
echo "$NAME running with PID: $pid"
|
||||
return 4
|
||||
else
|
||||
echo "$NAME is not running"
|
||||
return 3
|
||||
fi
|
||||
|
||||
return 4
|
||||
fi
|
||||
else
|
||||
pid=$(pidofproc "$pathname")
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "$NAME running with PID: $pid" && return 0
|
||||
echo "$NAME running with PID: $pid"
|
||||
return 0
|
||||
else
|
||||
echo "$NAME is not runing" && return 3
|
||||
echo "$NAME is not runing"
|
||||
return 3
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user