|
Lines 11-16
Link Here
|
| 11 |
# |
11 |
# |
| 12 |
# bareos_dir_enable (bool): Set to NO by default. |
12 |
# bareos_dir_enable (bool): Set to NO by default. |
| 13 |
# Set it to YES to enable bareos_dir. |
13 |
# Set it to YES to enable bareos_dir. |
|
|
14 |
# bareos_dir_configfile (foo/bar/file.conf): absolute path to bareos-dir |
| 15 |
# configuration file |
| 14 |
# bareos_dir_flags (params): Set params used to start bareos_dir. |
16 |
# bareos_dir_flags (params): Set params used to start bareos_dir. |
| 15 |
# |
17 |
# |
| 16 |
|
18 |
|
|
Lines 19-31
Link Here
|
| 19 |
name="bareos_dir" |
21 |
name="bareos_dir" |
| 20 |
rcvar=${name}_enable |
22 |
rcvar=${name}_enable |
| 21 |
command=%%PREFIX%%/sbin/bareos-dir |
23 |
command=%%PREFIX%%/sbin/bareos-dir |
|
|
24 |
bareos_dir_user="bareos" |
| 25 |
bareos_dir_group="bareos" |
| 26 |
bareos_dir_configfile="%%PREFIX%%/etc/bareos/bareos-dir.conf" |
| 27 |
start_precmd=${name}_prestart |
| 22 |
|
28 |
|
| 23 |
load_rc_config $name |
29 |
load_rc_config $name |
| 24 |
|
30 |
|
| 25 |
: ${bareos_dir_enable="NO"} |
31 |
: ${bareos_dir_enable="NO"} |
| 26 |
: ${bareos_dir_flags=" -u bareos -g bareos -v -c %%PREFIX%%/etc/bareos/bareos-dir.conf"} |
32 |
: ${bareos_dir_flags=" -u ${bareos_dir_user} -g ${bareos_dir_group} -v -c ${bareos_dir_configfile}"} |
| 27 |
: ${bareos_dir_pidfile="/var/run/bareos/bareos-dir.9101.pid"} |
33 |
: ${bareos_dir_pidfile="/var/run/bareos/bareos-dir.9101.pid"} |
| 28 |
|
34 |
|
| 29 |
pidfile="${bareos_dir_pidfile}" |
35 |
pidfile="${bareos_dir_pidfile}" |
| 30 |
|
36 |
|
|
|
37 |
required_files=${bareos_dir_configfile} |
| 38 |
required_dirs=${pidfile%/*} |
| 39 |
|
| 40 |
bareos_dir_prestart() |
| 41 |
{ |
| 42 |
[ -d "${pidfile%/*}" ] || install -d -o ${bareos_dir_user} -g ${bareos_dir_group} ${pidfile%/*} |
| 43 |
} |
| 44 |
|
| 45 |
|
| 31 |
run_rc_command "$1" |
46 |
run_rc_command "$1" |