From 0ac62b6e9ae2f65d099be0ea2b8a5424199fa8d0 Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Sun, 7 Oct 2018 16:11:58 -0500 Subject: [PATCH] Updated status_of_proc to properly deal with stopped process that uses pidfile --- Makefile | 2 +- SRC/initscripts/init-functions | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 86d2a9e..1ceb402 100644 --- a/Makefile +++ b/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 diff --git a/SRC/initscripts/init-functions b/SRC/initscripts/init-functions index 77431f3..4fd42cb 100755 --- a/SRC/initscripts/init-functions +++ b/SRC/initscripts/init-functions @@ -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 }