Project

General

Profile

Actions

Feature #2785

closed

graceful restart with SIGUSR1

Added by gstrauss almost 8 years ago. Updated almost 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

lighttpd should perform a graceful restart when SIGUSR1 is received; process id (pid) should not change

Limitations include (but might not be limited to) not working if lighttpd chroots (since config files and modules may not be present), and not being able to bind to new sockets on privileged ports requiring root privileges (if lighttpd has dropped privileges).


Related issues 1 (0 open1 closed)

Related to Bug #2782: init scripts outdated, should be removedFixed2017-01-14Actions
Actions #1

Updated by gstrauss almost 8 years ago

  • Related to Bug #2782: init scripts outdated, should be removed added
Actions #2

Updated by gstrauss almost 8 years ago

The following is not included in the upcoming patch, but is being considered.

Should lighttpd be modified to add graceful reload of configuration when lighttpd receives SIGHUP? Current lighttpd behavior is to just re-open error and access log files, and this should be preserved, but since reloading configuration on SIGHUP is a widely accepted convention, let's consider if lighttpd should add this behavior on SIGHUP, too.

--- a/src/server.c
+++ b/src/server.c
@@ -1362,6 +1362,7 @@ static int server_main (server * const srv, int argc, char **argv) {
                                                 */
                                                if (handle_sig_hup) {
                                                        handle_sig_hup = 0;
+                                                       if (buffer_string_is_empty(srv->srvconf.changeroot)) raise(SIGUSR1);

                                                        log_error_cycle(srv);

@@ -1513,6 +1514,7 @@ static int server_main (server * const srv, int argc, char **argv) {

                        /* reset notification */
                        handle_sig_hup = 0;
+                       if (buffer_string_is_empty(srv->srvconf.changeroot) && 0 == oneshot_fd) raise(SIGUSR1);

                        /* cycle logfiles */
Actions #3

Updated by gstrauss almost 8 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom