31 lines
730 B
Bash
Executable File
31 lines
730 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
NGINX_BIN="/usr/sbin/nginx"
|
|
NGINX_CONF="/etc/nginx/nginx.conf"
|
|
|
|
prepare_runtime() {
|
|
mkdir -p /tmp/nginx/client_body /tmp/nginx/proxy /tmp/nginx/fastcgi /tmp/nginx/uwsgi /tmp/nginx/scgi
|
|
}
|
|
|
|
start_service() {
|
|
prepare_runtime
|
|
"$NGINX_BIN" -t -c "$NGINX_CONF" || return 1
|
|
procd_open_instance
|
|
procd_set_param command "$NGINX_BIN" -c "$NGINX_CONF" -g "daemon off;"
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param file "$NGINX_CONF"
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
reload_service() {
|
|
prepare_runtime
|
|
"$NGINX_BIN" -t -c "$NGINX_CONF" || return 1
|
|
"$NGINX_BIN" -s reload -c "$NGINX_CONF"
|
|
}
|