Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
2 |
|
3 |
# $FreeBSD$ |
4 |
# |
5 |
# PROVIDE: parpd |
6 |
# REQUIRE: NETWORKING |
7 |
# KEYWORD: shutdown |
8 |
# |
9 |
# Add these lines to /etc/rc.conf.local or /etc/rc.conf |
10 |
# to enable this service: |
11 |
# parpd_enable = yes (default: no) |
12 |
# parpd_flags = full_path_of_the_configuration_file |
13 |
# (default: %%PREFIX%%/etc/parpd.conf) |
14 |
# |
15 |
# If multiple daemons (with different configs) needs to be running: |
16 |
# - make a (symbolic) link for this file to a different name (i.e. parpdXX) |
17 |
# - set the approbriate rc.conf variables (i.e. |
18 |
# parpdXX_enable = yes (default: no) |
19 |
# parpdXX_flags = %%PREFIX%%/etc/parpdXX.conf |
20 |
# ) |
21 |
|
22 |
. /etc/rc.subr |
23 |
|
24 |
name=${0##*/} |
25 |
eval "rcvar=${name}_enable" |
26 |
|
27 |
load_rc_config $name |
28 |
|
29 |
command=%%PREFIX%%/sbin/parpd |
30 |
extra_commands="reload" |
31 |
eval ": \${${name}_enable:='NO'}" |
32 |
eval ": \${${name}_flags:=%%PREFIX%%/etc/${name}.conf}" |
33 |
eval "config_file=\$${name}_flags" |
34 |
|
35 |
[ -s "$config_file" ] || err 1 "Missing configuration file '$config_file'" |
36 |
|
37 |
if get_pidfile_from_conf pidfile "$config_file"; then |
38 |
pidfile="$_pidfile_from_conf" |
39 |
else |
40 |
err 1 "$config_file does not specify an pidfile" |
41 |
fi |
42 |
run_rc_command "$1" |
43 |
native |
44 |
text/plain |