Project

General

Profile

Actions

Bug #267

closed

Reload in init.d script for debian

Added by Anonymous over 16 years ago. Updated over 13 years ago.

Status:
Wontfix
Priority:
Low
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

Since lighty now does a graceful shutdown, the "reload config" functionality in the init script should now work. Here is a patch that does it on debian:


svijaykr@ubuntu:~/work$ diff -urN lighttpd-1.4.3/debian/init.d exp/lighttpd-1.4.4/debian/init.d
--- lighttpd-1.4.3/debian/init.d        2005-08-11 03:56:59.000000000 +0530
+++ exp/lighttpd-1.4.4/debian/init.d    2005-09-14 23:14:15.934780168 +0530
@@ -48,10 +48,17 @@
        #       If the daemon responds to changes in its config file
        #       directly anyway, make this a do-nothing entry.
        #
+
+       # A SIGINT causes lighty to reload the config file
+
        echo "Reloading $DESC configuration files." 
-       start-stop-daemon --stop --signal 1 --quiet --pidfile /var/run/$NAME.pid \
+       start-stop-daemon --stop --signal 2 --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON
+       sleep 5
+       start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $OPTS
+       echo "$NAME." 
   ;;
+
   restart|force-reload)
        #
        #       If the "reload" option is implemented, move the "force-reload" 

-- svijaykr


Files

diff.txt (1.57 KB) diff.txt alternate patch for lighttpd init script for graceful restart -- jbyers Anonymous, 2005-10-03 00:59
Actions #1

Updated by Anonymous over 16 years ago

I've attached an alternate patch for reload. The original patch waits 5 seconds for the old lighttpd to die. During this time, new connections are not accepted. And, there's no guarantee 5 seconds is enough; on high load systems, it may take minutes for old connections to time out.

Instead, send -INT, immediately remove the old pid file, and start a new lighttpd. Wait only 1 second to be sure that on high-load systems the old lighttpd really did release its sockets.

This patch seems to work fine on our production systems.

-- jbyers

Actions #2

Updated by stbuehler over 13 years ago

  • Status changed from New to Fixed
  • Resolution set to wontfix

Distribution specific.

Actions #3

Updated by stbuehler over 13 years ago

  • Status changed from Fixed to Wontfix
Actions

Also available in: Atom