From 69c9cb05687d34615f39ae0fdd5923d0a92b941f Mon Sep 17 00:00:00 2001 From: Don Penney Date: Fri, 3 May 2019 14:42:25 -0400 Subject: [PATCH] Fix bug in patch-alarm-manager start check The start function of the patch-alarm-manager init script checks for a valid pidfile to see if the process is already running. Unfortunately, the code has a couple of typos that cause the check to fail if the "start" is called when the process is already running. This commit fixes the typos. Change-Id: If46f03a5d042f949db9359d6ddd7f69790ccaf4f Closes-Bug: 1827326 Signed-off-by: Don Penney --- patch-alarm/scripts/init.d/patch-alarm-manager | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patch-alarm/scripts/init.d/patch-alarm-manager b/patch-alarm/scripts/init.d/patch-alarm-manager index 0e3294a3..ef794db5 100644 --- a/patch-alarm/scripts/init.d/patch-alarm-manager +++ b/patch-alarm/scripts/init.d/patch-alarm-manager @@ -22,8 +22,9 @@ PIDFILE=$RUNDIR/$DESC.pid start() { if [ -e $PIDFILE ]; then - PIDDIR=/prod/$(cat $PIDFILE) - if [ -d ${PIDFILE} ]; then + PID=$(cat $PIDFILE) + PIDDIR=/proc/${PID} + if [ -n "${PID}" -a -d ${PIDDIR} ]; then echo "$DESC already running." exit 0 else