From 042e64bf1d6642dde0f95fc97fffed5e7296357c Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Tue, 12 Dec 2017 12:33:34 +0100 Subject: [PATCH] B #1562: sunstone-server rc handling broken (#1576) --- src/sunstone/bin/sunstone-server | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sunstone/bin/sunstone-server b/src/sunstone/bin/sunstone-server index 614992b8d6..162a0973bb 100755 --- a/src/sunstone/bin/sunstone-server +++ b/src/sunstone/bin/sunstone-server @@ -128,8 +128,8 @@ stop() [ "$novnc" = "1" ] && $NOVNC_SERVER stop if [ ! -f $SUNSTONE_PID ]; then - echo "Couldn't find sunstone-server process pid." - exit 1 + echo "Couldn't find sunstone-server process pid." >&2 + return 1 fi # Kill the sunstone daemon @@ -140,6 +140,7 @@ stop() rm -f $SUNSTONE_PID &> /dev/null echo "sunstone-server stopped" + return 0 } case "$1" in @@ -149,9 +150,10 @@ case "$1" in ;; stop) stop -n + exit $? ;; restart) - stop -n + stop -n 2> /dev/null setup start -n ;; @@ -163,7 +165,7 @@ case "$1" in stop ;; restart-sunstone) - stop + stop -n 2> /dev/null setup start ;;