aboutsummaryrefslogtreecommitdiffstats
path: root/www/nginx/files/nginx.sh.in
blob: b28a5bacb706c45b65838d3814788a035cfa7085 (plain) (blame)
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
# $FreeBSD$

# PROVIDE: nginx
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define these nginx_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#       /etc/rc.conf.d/nginx
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
nginx_enable=${nginx_enable-"NO"}
nginx_flags=${nginx_flags-""}
nginx_pidfile=${nginx_pidfile-"/var/run/nginx.pid"}

. %%RC_SUBR%%

name="nginx"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/nginx"

extra_commands="configtest"

configtest_cmd="configtest_cmd"
configtest_cmd()  {
    echo "Configuration syntax test for ${name}."
    if ${command} -t; then
        :
    else
        err 8 "FATAL: bad config for ${name}"
    fi
}

load_rc_config $name

pidfile="${nginx_pidfile}"

start_cmd="echo \"Starting ${name}.\"; /usr/bin/limits -U www ${command} ${nginx_flags}"

run_rc_command "$1"