ports/110683: [UPDATE] port www/lighttpd: add support for graceful reload in rc script
Peter Beckman
beckman at purplecow.com
Thu Mar 22 16:00:23 UTC 2007
>Number: 110683
>Category: ports
>Synopsis: [UPDATE] port www/lighttpd: add support for graceful reload in rc script
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Mar 22 16:00:22 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Peter Beckman
>Release: FreeBSD 6.1-RELEASE-p10 i386
>Organization:
>Environment:
System: FreeBSD iax2 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #0: Mon Oct 9 15:50:07 UTC 2006 root at iax2:/usr/obj/usr/src/sys/SMP i386
>Description:
Attached is a proposed diff that supports the graceful shutdown of lighttpd, and because "graceful" isn't an option
in rc.subr, I used reload and some pre/post commands to actually do the reload gracefully.
http://blog.lighttpd.net/articles/2005/09/02/graceful-restart
>How-To-Repeat:
>
>Fix:
--- lighttpd.orig Thu Mar 22 15:30:24 2007
+++ lighttpd.new Thu Mar 22 15:29:26 2007
@@ -29,7 +29,11 @@
pidfile=/var/run/lighttpd.pid
required_files=${lighttpd_conf}
stop_postcmd=stop_postcmd
+reload_precmd=reload_precmd
+reload_postcmd=reload_postcmd
restart_precmd="checkconfig"
+extra_commands="reload"
+sig_reload="SIGINT"
checkconfig()
{
@@ -40,6 +44,17 @@
stop_postcmd()
{
rm -f ${pidfile}
+}
+
+reload_precmd()
+{
+ echo "Stopping ${name} gracefully."
+}
+
+reload_postcmd()
+{
+ echo "Restarting ${name}."
+ eval "${command} ${command_args}"
}
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list