ports/136232: nginx: Add 'gracefulstop' option to rc script

Mike Andrews mandrews at bit0.com
Wed Jul 1 20:20:03 UTC 2009


>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 at 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:



More information about the freebsd-ports-bugs mailing list