From d4decad40210d2dacc1dd25ae3458397b953e784 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 1 May 2010 10:41:45 +0200 Subject: [PATCH] Fix bug #1538 Start Scripts return incorrect value --- bacula/platforms/debian/bacula-dir.in | 8 +++++--- bacula/platforms/debian/bacula-fd.in | 8 +++++--- bacula/platforms/debian/bacula-sd.in | 8 +++++--- bacula/platforms/suse/bacula-dir.in | 19 ++++++++++--------- bacula/platforms/suse/bacula-fd.in | 3 ++- bacula/platforms/suse/bacula-sd.in | 3 ++- bacula/platforms/ubuntu/bacula-dir.in | 4 +++- bacula/platforms/ubuntu/bacula-fd.in | 4 +++- bacula/platforms/ubuntu/bacula-sd.in | 4 +++- 9 files changed, 38 insertions(+), 23 deletions(-) diff --git a/bacula/platforms/debian/bacula-dir.in b/bacula/platforms/debian/bacula-dir.in index a1ad368aad..1ad675c963 100644 --- a/bacula/platforms/debian/bacula-dir.in +++ b/bacula/platforms/debian/bacula-dir.in @@ -9,13 +9,13 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # ### BEGIN INIT INFO -# Provides: bacula-dir +# Provides: bacula-dir # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start @BACULA@ Director daemon at boot time -# Description: Enable @BACULA@ Director. +# Description: Enable @BACULA@ Director. ### END INIT INFO # @@ -48,11 +48,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -65,4 +67,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/debian/bacula-fd.in b/bacula/platforms/debian/bacula-fd.in index 1d1c90adaf..100e6a6817 100644 --- a/bacula/platforms/debian/bacula-fd.in +++ b/bacula/platforms/debian/bacula-fd.in @@ -9,13 +9,13 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # ### BEGIN INIT INFO -# Provides: bacula-fd +# Provides: bacula-fd # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start @BACULA@ Client daemon at boot time -# Description: Enable @BACULA@ Client. +# Description: Enable @BACULA@ Client. ### END INIT INFO @@ -48,11 +48,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -65,4 +67,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/debian/bacula-sd.in b/bacula/platforms/debian/bacula-sd.in index 4b0f712f86..62aa4c4d2f 100644 --- a/bacula/platforms/debian/bacula-sd.in +++ b/bacula/platforms/debian/bacula-sd.in @@ -9,13 +9,13 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # ### BEGIN INIT INFO -# Provides: bacula-sd +# Provides: bacula-sd # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start @BACULA@ Storage daemon at boot time -# Description: Enable @BACULA@ Storage daemon. +# Description: Enable @BACULA@ Storage daemon. ### END INIT INFO @@ -48,11 +48,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -65,4 +67,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/suse/bacula-dir.in b/bacula/platforms/suse/bacula-dir.in index b583d043bd..546ff5be40 100755 --- a/bacula/platforms/suse/bacula-dir.in +++ b/bacula/platforms/suse/bacula-dir.in @@ -1,7 +1,7 @@ #! /bin/sh # # bacula This shell script takes care of starting and stopping -# the bacula Director daemon +# the bacula Director daemon # # chkconfig: 2345 90 9 # description: It comes by night and sucks the vital essence from your computers. @@ -12,13 +12,13 @@ # Added LSB init info 10/14/2004 D. Scott Barninger # ### BEGIN INIT INFO -# Provides: bacula-dir -# Required-Start: $local_fs $network @DB_TYPE@ -# Required-Stop: $local_fs $network @DB_TYPE@ -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: bacula director -# Description: Bacula network backup system director daemon +# Provides: bacula-dir +# Required-Start: $local_fs $network @DB_TYPE@ +# Required-Stop: $local_fs $network @DB_TYPE@ +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: bacula director +# Description: Bacula network backup system director daemon ### END INIT INFO # source process status functions @@ -50,6 +50,7 @@ case "$1" in ;; status) /sbin/checkproc @sbindir@/bacula-dir + RETVAL=$? rc_status -v ;; *) @@ -57,4 +58,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/suse/bacula-fd.in b/bacula/platforms/suse/bacula-fd.in index 547acd20bc..5c9b17f7a4 100755 --- a/bacula/platforms/suse/bacula-fd.in +++ b/bacula/platforms/suse/bacula-fd.in @@ -49,6 +49,7 @@ case "$1" in ;; status) /sbin/checkproc @sbindir@/bacula-fd + RETVAL=$? rc_status -v ;; *) @@ -56,4 +57,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/suse/bacula-sd.in b/bacula/platforms/suse/bacula-sd.in index a6093db23b..12838171a6 100755 --- a/bacula/platforms/suse/bacula-sd.in +++ b/bacula/platforms/suse/bacula-sd.in @@ -49,6 +49,7 @@ case "$1" in ;; status) /sbin/checkproc @sbindir@/bacula-sd + RETVAL=$? rc_status -v ;; *) @@ -56,4 +57,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/ubuntu/bacula-dir.in b/bacula/platforms/ubuntu/bacula-dir.in index 9bf09c9836..c75a57269f 100644 --- a/bacula/platforms/ubuntu/bacula-dir.in +++ b/bacula/platforms/ubuntu/bacula-dir.in @@ -45,11 +45,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -62,4 +64,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/ubuntu/bacula-fd.in b/bacula/platforms/ubuntu/bacula-fd.in index 673ef54ce7..87d9bf00d7 100644 --- a/bacula/platforms/ubuntu/bacula-fd.in +++ b/bacula/platforms/ubuntu/bacula-fd.in @@ -45,11 +45,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -62,4 +64,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/ubuntu/bacula-sd.in b/bacula/platforms/ubuntu/bacula-sd.in index 3a1e6b1db1..1ddca02a44 100644 --- a/bacula/platforms/ubuntu/bacula-sd.in +++ b/bacula/platforms/ubuntu/bacula-sd.in @@ -45,11 +45,13 @@ case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} + RETVAL=$? echo "${NAME}" ;; restart|force-reload) @@ -62,4 +64,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL -- 2.39.5