Date: Wed, 1 Jul 2009 16:18:52 -0400 (EDT) From: Mike Andrews <mandrews@bit0.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/136232: nginx: Add 'gracefulstop' option to rc script Message-ID: <20090701201852.4941AED51@bourbon.fark.com> Resent-Message-ID: <200907012020.n61KK2oF079689@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 136232 >Category: ports >Synopsis: nginx: Add 'gracefulstop' option to rc script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jul 01 20:20:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Mike Andrews >Release: FreeBSD 7.2-STABLE amd64 >Organization: Fark, Inc >Environment: System: FreeBSD bourbon.fark.com 7.2-STABLE FreeBSD 7.2-STABLE #15: Tue Jun 16 01:46:10 EDT 2009 mandrews@vodka.int.fark.com:/usr/obj/usr/src/sys/FARK64 amd64 >Description: The /usr/local/etc/rc.d script for Apache has a "gracefulstop" and "gracefulrestart" option in it. nginx has this capability via signals, but the rc script doesn't directly support all of it. The "upgrade" option more or less handles the "gracefulrestart" case. Here is a very simple patch for the "gracefulstop" case. >How-To-Repeat: n/a >Fix: *** /usr/local/etc/rc.d/nginx.orig Fri Jun 19 23:52:48 2009 --- /usr/local/etc/rc.d/nginx Wed Jul 1 16:12:40 2009 *************** *** 30,35 **** --- 30,36 ---- configtest_cmd="nginx_checkconfig" upgrade_precmd="nginx_checkconfig" upgrade_cmd="nginx_upgrade" + gracefulstop_cmd="nginx_gracefulstop" command="/usr/local/sbin/nginx" _pidprefix="/var/run/nginx" pidfile="${_pidprefix}.pid" *************** *** 100,105 **** --- 101,114 ---- run_rc_command ${rc_prefix}reload $rc_extra_args || return 1 } + nginx_gracefulstop() + { + echo "Performing a graceful stop" + + sig_stop="QUIT" + run_rc_command ${rc_prefix}stop $rc_extra_args || return 1 + } + nginx_precmd() { nginx_checkconfig *************** *** 112,116 **** fi } ! extra_commands="reload configtest upgrade" run_rc_command "$1" --- 121,125 ---- fi } ! extra_commands="reload configtest upgrade gracefulstop" run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090701201852.4941AED51>