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