summaryrefslogtreecommitdiff
path: root/www/nginx/files/nginx.in
diff options
context:
space:
mode:
authorJochen Neumeister <joneum@FreeBSD.org>2022-01-07 14:11:05 +0100
committerJochen Neumeister <joneum@FreeBSD.org>2022-01-07 14:12:15 +0100
commit7cdfb588b4ced018428ce752e88f24e919ceb1aa (patch)
tree0e7bd21a86a2e3db22da3743e3a070a68ee88199 /www/nginx/files/nginx.in
parentdevel/c4core: New port: Library of low-level C++ utilities (diff)
www/nginx: add the ability to customize the stop signal
PR: 254961 Sponsored by: Netzkommune GmbH
Diffstat (limited to 'www/nginx/files/nginx.in')
-rw-r--r--www/nginx/files/nginx.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/www/nginx/files/nginx.in b/www/nginx/files/nginx.in
index ef1c0561e421..37d2c182ebca 100644
--- a/www/nginx/files/nginx.in
+++ b/www/nginx/files/nginx.in
@@ -25,13 +25,15 @@
# nginx_http_accept_enable (bool): Set to "NO" by default.
# Set to yes to check for accf_http kernel module
# on start-up and load if not loaded.
+# nginx_sig_stop (str): Default to "_TERM"
. /etc/rc.subr
name="nginx"
rcvar=nginx_enable
-start_precmd="nginx_precmd"
+start_precmd="nginx_prestart"
+stop_precmd="nginx_prestop"
restart_precmd="nginx_checkconfig"
reload_precmd="nginx_checkconfig"
configtest_cmd="nginx_checkconfig"
@@ -131,7 +133,7 @@ nginx_upgrade()
run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
}
-nginx_precmd()
+nginx_prestart()
{
if checkyesno nginx_http_accept_enable
then
@@ -148,4 +150,9 @@ nginx_precmd()
fi
}
++nginx_prestop()
+{
+ sig_stop="${nginx_sig_stop:-TERM}"
+}
+
run_rc_command "$1"