lighty's life

lighty developer blog

Graceful Restart

With lighttpd 1.4.3 it is possible to do a graceful shutdown by sending a SIGINT to the process. It will only shutdown the server after the client connections are closed successfully without interrupting the connections.

But can this be used to implement ‘reload config on signal’ or ‘graceful restart’ ?

When we added graceful shutdown we kept in mind to allow a graceful restart and reloading the configuration without interrupting running connections in the same run.

The idea is the following:

  1. the old process gets a SIGINT to close the server sockets and ignore all incoming connections for it, but continues to run until all connections are finished.
  2. a new process is started, connects to the unbound server sockets and serves all the new connections.

Up to now the start scripts don’t implement this, but this is the challenge for you.

Please try out if our idea works as planed:

...
   reload)
     killproc -INT $LIGHTTPD_BIN
     $0 start
     ;;

If your system is LSB conform you should be able to use the updated rc.lighttpd

Enable javascript to load comments.

Please note that we won't accept comments for posts older than 3 months! Also please use our bug tracker to report bugs, and our irc channel #lighttpd@freenode to chat.

« Spice up for error page Improved Upload handling »