Merge pull request #886 from theopolis/init_fix

[Fix #884] Remove return 1s when no action needed in init
This commit is contained in:
Mike Arpaia 2015-03-19 16:44:24 -07:00
commit 7a4c40ea05

View File

@ -66,8 +66,7 @@ start() {
PID=$(cat $PIDFILE)
PROCNAME=$(ps -p $PID -o comm\=)
if [ "$PROCNAME" = "$PROG" ]; then
echo "$PROG is already running: $PID"
return 1
return 0
else
# osqueryd pidfile exists but it's not running
rm $PIDFILE
@ -87,8 +86,7 @@ stop() {
ensure_root
if [ ! -f $PIDFILE ] ; then
echo "$PROG is not running. no pidfile found."
return 1
return 0
else
PID=$(cat $PIDFILE)
pkill -P $PID && kill -9 $PID