run.sh: fix -status command exit codes 79/4379/1
authorChris Wright <chrisw@sous-sol.org>
Sun, 19 Jan 2014 07:37:05 +0000 (23:37 -0800)
committerChris Wright <chrisw@sous-sol.org>
Sun, 19 Jan 2014 07:43:34 +0000 (23:43 -0800)
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 <chrisw@sous-sol.org>
opendaylight/distribution/opendaylight/src/main/resources/run.sh

index 1f3e8e20f3c9b596275868549ac1707f3a2e69d3..90e3b03ae4b7168fcc51a70a32499caca2086515 100755 (executable)
@@ -190,7 +190,7 @@ if [ "${statusdaemon}" -eq 1 ]; then
         else
             echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist"
             rm -f "${pidfile}"
         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"
         fi
     else
         echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found"