From 668f1c98b66e8b202519a3560f0c571a83a48e08 Mon Sep 17 00:00:00 2001 From: Allan Vidal Date: Wed, 2 Sep 2015 15:56:46 -0300 Subject: [PATCH] Make init script properly indicate error conditions. --- confluent_server/sysvinit/confluent | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/confluent_server/sysvinit/confluent b/confluent_server/sysvinit/confluent index 94852435..6260dc54 100755 --- a/confluent_server/sysvinit/confluent +++ b/confluent_server/sysvinit/confluent @@ -11,9 +11,11 @@ if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions LOG_SUCCESS=success + LOG_FAILURE=failure elif [ -f /lib/lsb/init-functions ]; then . /lib/lsb/init-functions LOG_SUCCESS=log_success_msg + LOG_FAILURE=log_failure_msg else echo "Unknown platform" exit 1 @@ -35,9 +37,15 @@ stop() { start() { echo -n 'Starting Confluent: ' $confluent - $LOG_SUCCESS - echo - return + if [ $? -eq 0 ]; then + $LOG_SUCCESS + echo + return 0 + else + $LOG_FAILURE + echo + return 1 + fi } case $1 in