blob: 25ab52c8bd443a1cdea6fb7dece5218d1c730b7b (
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
|
#!/bin/sh
# PROVIDE: nginx_ui
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for NGINX UI in /etc/rc.conf
#
# nginx_ui_enable (bool): Enable NGINX UI. (default=NO)
# nginx_ui_log (str): Log output. (default=/var/log/nginx-ui.log)
# nginx_ui_runas (str): User to run NGINX UI as. (default=%%USER%%)
#
. /etc/rc.subr
name="nginx_ui"
desc="Yet another WebUI for Nginx"
rcvar="${name}_enable"
load_rc_config $name
: ${nginx_ui_enable:="NO"}
: ${nginx_ui_log:="/var/log/nginx-ui.log"}
: ${nginx_ui_runas:="%%USER%%"}
nginx_ui_chdir="/var/db/nginx-ui"
pidfile="/var/run/nginx-ui.pid"
procname="%%LOCALBASE%%/bin/nginx-ui"
command="/usr/sbin/daemon"
command_args="-o ${nginx_ui_log} -u ${nginx_ui_runas} -p ${pidfile} -t \"${desc}\" ${procname}"
# If, for example, there is a power failure, the UNIX socket file will be left and
# the error "connect: connection refused" will be displayed, so the best thing to
# do is to delete it before starting NGINX UI.
start_precmd="rm -f /var/db/nginx-ui/nginx-ui.sock"
run_rc_command "$1"
|