blob: 14fc30840469b2d8aff890021630677ab77cf708 (
plain)
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
|
#!/bin/sh
# PROVIDE: parpd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
# parpd_enable = yes (default: no)
# parpd_flags = full_path_of_the_configuration_file
# (default: %%PREFIX%%/etc/parpd.conf)
#
# If multiple daemons (with different configs) needs to be running:
# - copy this file to a different name (i.e. parpdXX)
# - change the "name" and "rcvar" values to the new name
# - set the approbriate rc.conf variables (i.e.
# parpdXX_enable = yes (default: no)
# parpdXX_flags = %%PREFIX%%/etc/parpdXX.conf
# )
. /etc/rc.subr
name=parpd
rcvar=parpd_enable
load_rc_config $name
command=%%PREFIX%%/sbin/parpd
extra_commands="reload"
eval ": \${${name}_enable:='NO'}"
eval ": \${${name}_flags:=%%PREFIX%%/etc/${name}.conf}"
eval "config_file=\$${name}_flags"
if [ -s "$config_file" ] && get_pidfile_from_conf pidfile "$config_file"; then
pidfile="$_pidfile_from_conf"
else
pidfile="/var/run/parpd.pid"
fi
eval "unset ${name}_flags"
command_args="$config_file"
run_rc_command "$1"
|