/
bareos-fd.in
56 lines (54 loc) · 1.8 KB
/
bareos-fd.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /bin/sh
#
# bareos This shell script takes care of starting and stopping
# the bareos File daemon.
#
# chkconfig: 2345 90 9
# description: Backup Archiving REcovery Open Sourced.
#
# For Bareos release @VERSION@ (@DATE@) -- @DISTNAME@
# Copyright (C) 2011 Free Software Foundation Europe e.V.
# Modified to work on SuSE 1/31/2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
# Added rc.status functions 3/13/2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
# Added LSB init info 10/14/2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
# Added $remote_fs, add bareos specific daemon user & group Bruno Friedmann <bruno@ioda-net.ch>
#
### BEGIN INIT INFO
# Provides: bareos-fd
# 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
# Description: Bareos network backup system file daemon
### END INIT INFO
# source process status functions
# this gives us funtion rc_status -v to tell us if we succeed or fail
. /etc/rc.status
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
rc_status -v && touch @subsysdir@/bareos-fd
;;
stop)
echo -n "Stopping the Bareos File daemon: "
/sbin/killproc @sbindir@/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
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
rc_exit