Added
Link Here
|
1 |
#!/bin/sh |
2 |
# |
3 |
# |
4 |
# PROVIDE: %%PORTNAME%% |
5 |
# REQUIRE: NETWORKING |
6 |
# KEYWORD: |
7 |
# |
8 |
# Add the following lines to /etc/rc.conf to enable %%PORTNAME%%: |
9 |
# %%PORTNAME%%_enable="YES" |
10 |
# |
11 |
# %%PORTNAME%%_enable (bool): Set to YES to enable %%PORTNAME%% |
12 |
# Default: NO |
13 |
# %%PORTNAME%%_bind (str): HTTP server host |
14 |
# Default: localhost |
15 |
# %%PORTNAME%%_listen (str): HTTP server listen port |
16 |
# Default: 8081 |
17 |
# %%PORTNAME%%_user (str): %%PORTNAME%% daemon user |
18 |
# Default: %%PGWEBUSER%% |
19 |
# %%PORTNAME%%_group (str): %%PORTNAME%% daemon group |
20 |
# Default: %%PGWEBGROUP%% |
21 |
|
22 |
. /etc/rc.subr |
23 |
|
24 |
name="%%PORTNAME%%" |
25 |
rcvar="%%PORTNAME%%_enable" |
26 |
load_rc_config $name |
27 |
|
28 |
: ${%%PORTNAME%%_user:="www"} |
29 |
: ${%%PORTNAME%%_group:="www"} |
30 |
: ${%%PORTNAME%%_enable:="NO"} |
31 |
: ${%%PORTNAME%%_bind:="localhost"} |
32 |
: ${%%PORTNAME%%_flags=""} |
33 |
: ${%%PORTNAME%%_facility:="daemon"} |
34 |
: ${%%PORTNAME%%_priority:="debug"} |
35 |
: ${%%PORTNAME%%_listen:="8081"} |
36 |
|
37 |
procname="%%PREFIX%%/bin/${name}" |
38 |
pidfile="/var/run/${name}.pid" |
39 |
start_precmd="${name}_precmd" |
40 |
command=/usr/sbin/daemon |
41 |
command_args="-S -l ${%%PORTNAME%%_facility} -s ${%%PORTNAME%%_priority} -T ${name} -t ${name} -p ${pidfile} \ |
42 |
${procname} --bind=${%%PORTNAME%%_bind} --listen=${%%PORTNAME%%_listen} ${%%PORTNAME%%_flags}" |
43 |
|
44 |
%%PORTNAME%%_precmd() |
45 |
{ |
46 |
install -o ${%%PORTNAME%%_user} /dev/null ${pidfile} |
47 |
} |
48 |
|
49 |
run_rc_command "$1" |
50 |
|