Skip to content

Commit

Permalink
daemon start scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Oct 9, 2018
1 parent 70aa44f commit d71b622
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 80 deletions.
36 changes: 9 additions & 27 deletions core/platforms/freebsd/bareos-dir.in
Expand Up @@ -8,31 +8,13 @@
#
# For Bareos release @VERSION@ (@DATE@) -- @DISTNAME@
#
. /etc/rc.subr

name=bareosdir
rcvar=bareosdir_enable

command="@sbindir@/bareos-dir"

load_rc_config $name
run_rc_command "$1"

RETVAL=0
case "$1" in
start)
echo "Starting the Bareos Director: "
@sbindir@/bareos-dir $2 -c @confdir@/bareos-dir.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-dir
;;
stop)
echo "Stopping the Director daemon: "
# killproc @sbindir@/bareos-dir
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-dir
;;
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
37 changes: 10 additions & 27 deletions core/platforms/freebsd/bareos-fd.in
@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/sh
#
# bareos This shell script takes care of starting and stopping
# the bareos File daemon.
Expand All @@ -8,30 +8,13 @@
#
# For Bareos release @VERSION@ (@DATE@) -- @DISTNAME@
#
. /etc/rc.subr

name=bareosfd
rcvar=bareosfd_enable

command="@sbindir@/bareos-fd"

load_rc_config $name
run_rc_command "$1"

case "$1" in
start)
echo "Starting the Bareos File daemon: "
@sbindir@/bareos-fd $2 -c @confdir@/bareos-fd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-fd
;;
stop)
echo "Stopping the Bareos File daemon: "
# killproc @sbindir@/bareos-fd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-fd
;;
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
35 changes: 9 additions & 26 deletions core/platforms/freebsd/bareos-sd.in
Expand Up @@ -8,30 +8,13 @@
#
# For Bareos release @VERSION@ (@DATE@) -- @DISTNAME@
#
. /etc/rc.subr

name=bareossd
rcvar=bareossd_enable

command="@sbindir@/bareos-sd"

load_rc_config $name
run_rc_command "$1"

case "$1" in
start)
echo "Starting the Bareos Storage daemon: "
@sbindir@/bareos-sd $2 -c @confdir@/bareos-sd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bareos-sd
;;
stop)
echo "Stopping the Bareos Storage daemon: "
# killproc @sbindir@/bareos-sd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f @subsysdir@/bareos-sd
;;
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0

0 comments on commit d71b622

Please sign in to comment.