Skip to content

Commit

Permalink
bugfix: init scripts status on SUSE systems
Browse files Browse the repository at this point in the history
init scripts have been broken.
This patch makes small adjustments, to fix these problems.

Fixes #69: /etc/init.d/bareos-* status always return "running", even if daemon does not run

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed May 5, 2013
1 parent 588563c commit 1df761d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 39 deletions.
26 changes: 11 additions & 15 deletions platforms/suse/bareos-dir.in
Expand Up @@ -14,11 +14,13 @@
# Added $remote_fs, add bareos specific daemon user & group Bruno Friedmann <bruno@ioda-net.ch>
#
### BEGIN INIT INFO
# Provides: bareos-dir
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Provides: bareos-dir
# Required-Start: $local_fs $remote_fs $network $time $syslog
# Should-Start: postgresql mysql bareos-sd bareos-fd
# Required-Stop: $local_fs $remote_fs $network
# Should-Stop: postgresql mysq bareos-sd bareos-fd
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: bareos director
# Description: Bareos network backup system director daemon
### END INIT INFO
Expand All @@ -32,32 +34,26 @@ case "$1" in
start)
echo -n "Starting the Bareos Director: "
/sbin/startproc -u @dir_user@ -g @dir_group@ @sbindir@/bareos-dir $2 -c @sysconfdir@/bareos-dir.conf
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-dir
rc_status -v && touch @subsysdir@/bareos-dir
;;
stop)
echo -n "Stopping the Director daemon: "
/sbin/killproc @sbindir@/bareos-dir
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-dir
rc_status -v && rm -f @subsysdir@/bareos-dir
;;
restart)
$0 stop
sleep 5
$0 start
;;
status)
echo -n "Checking for Bareos director "
/sbin/checkproc @sbindir@/bareos-dir
RETVAL=$?
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit $RETVAL
rc_exit
18 changes: 6 additions & 12 deletions platforms/suse/bareos-fd.in
Expand Up @@ -15,8 +15,8 @@
#
### BEGIN INIT INFO
# Provides: bareos-fd
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Required-Start: $local_fs $remote_fs $network $time $syslog
# Required-Stop: $local_fs $remote_fs $network $time $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: bareos file daemon
Expand All @@ -31,32 +31,26 @@ case "$1" in
start)
echo -n "Starting the Bareos File daemon: "
/sbin/startproc -u @fd_user@ -g @fd_group@ @sbindir@/bareos-fd $2 -c @sysconfdir@/bareos-fd.conf
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-fd
rc_status -v && touch @subsysdir@/bareos-fd
;;
stop)
echo -n "Stopping the Bareos File daemon: "
/sbin/killproc @sbindir@/bareos-fd
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-fd
rc_status -v && rm -f @subsysdir@/bareos-fd
;;
restart)
$0 stop
sleep 5
$0 start
;;
status)
echo -n "Checking for Bareos file daemon "
/sbin/checkproc @sbindir@/bareos-fd
RETVAL=$?
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit $RETVAL
rc_exit
18 changes: 6 additions & 12 deletions platforms/suse/bareos-sd.in
Expand Up @@ -15,8 +15,8 @@
#
### BEGIN INIT INFO
# Provides: bareos-sd
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Required-Start: $local_fs $remote_fs $network $time $syslog
# Required-Stop: $local_fs $remote_fs $network $time $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: bareos storage daemon
Expand All @@ -31,32 +31,26 @@ case "$1" in
start)
echo -n "Starting the Bareos Storage daemon: "
/sbin/startproc -u @sd_user@ -g @sd_group@ @sbindir@/bareos-sd $2 -c @sysconfdir@/bareos-sd.conf
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-sd
rc_status -v && touch @subsysdir@/bareos-sd
;;
stop)
echo -n "Stopping the Bareos Storage daemon: "
/sbin/killproc @sbindir@/bareos-sd
RETVAL=$?
rc_status -v
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-sd
rc_status -v && rm -f @subsysdir@/bareos-sd
;;
restart)
$0 stop
sleep 5
$0 start
;;
status)
echo -n "Checking for Bareos storage daemon "
/sbin/checkproc @sbindir@/bareos-sd
RETVAL=$?
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit $RETVAL
rc_exit

0 comments on commit 1df761d

Please sign in to comment.