From: Chris Wright Date: Sun, 19 Jan 2014 07:37:05 +0000 (-0800) Subject: run.sh: fix -status command exit codes X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~45^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=6a83cd72792a38c4956c76ff95be54fcda32f710;hp=b369c0185a99952c3609aad40ebeba3e4be8c5b2 run.sh: fix -status command exit codes Currently -status command exits with exit code 0 to represent both 'running' and 'not running' state when pidfile is found and -1 when pidfile is not found (likely not running). Overloading exit code 0 makes wrapper scripts incapable of differentiating 'running' from 'not running.' Make 0 == running, 1 == not running, and -1 likely not running. Change-Id: Ic258ab34e03ae1777b00bab75d1cfe30bc6c90da Signed-off-by: Chris Wright --- diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.sh b/opendaylight/distribution/opendaylight/src/main/resources/run.sh index 1f3e8e20f3..90e3b03ae4 100755 --- a/opendaylight/distribution/opendaylight/src/main/resources/run.sh +++ b/opendaylight/distribution/opendaylight/src/main/resources/run.sh @@ -190,7 +190,7 @@ if [ "${statusdaemon}" -eq 1 ]; then else echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist" rm -f "${pidfile}" - exit 0 + exit 1 fi else echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found"