From 7cdfb588b4ced018428ce752e88f24e919ceb1aa Mon Sep 17 00:00:00 2001 From: Jochen Neumeister Date: Fri, 7 Jan 2022 14:11:05 +0100 Subject: www/nginx: add the ability to customize the stop signal PR: 254961 Sponsored by: Netzkommune GmbH --- www/nginx/files/nginx.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'www/nginx/files') 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" -- cgit v1.2.3