blob: b12a56d1eba1d5ca31ad97ff68a7ad56a87bac8d (
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
44
|
#!/bin/sh
# PROVIDE: pserv
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
# /etc/rc.conf lines:
# pserv_enable="YES" # enable pserv
# pserv_user="pop" # user for pserv
. /etc/rc.subr
name="pserv"
rcvar=pserv_enable
load_rc_config $name
: ${pserv_enable="NO"}
: ${pserv_user="pop"}
command="%%PREFIX%%/sbin/pserv"
start_precmd="${name}_prestart"
start_postcmd="${name}_configure"
extra_commands="reload"
reload_cmd="${name}_configure"
pproxy_prestart()
{
mkdir -p /var/log/popular
chown ${pserv_user} /var/log/popular
mkdir -p /var/run/popular
chown ${pserv_user} /var/run/popular
}
pproxy_configure()
{
if [ -f %%PREFIX%%/etc/popular/pserv.rc ]; then
sleep 1;
su -m ${pserv_user} -c "%%PREFIX%%/bin/pcontrol --program=pserv %%PREFIX%%/etc/popular/pserv.rc"
fi
}
run_rc_command "$1"
|