diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2017-01-24 18:40:28 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2017-01-31 14:40:05 -0500 |
commit | 0ae6bab4a97f12a0c93200df36ac1741696eeed5 (patch) | |
tree | 5f38d9b1fce3d7f942adcbd5e02b3e50fc84d17a /src/lighttpd-angel.c | |
parent | b63c9011c392a3cb0a2e8df82301e5b6002905c9 (diff) | |
download | lighttpd-git-0ae6bab4a97f12a0c93200df36ac1741696eeed5.tar.gz |
[doc] SIGUSR1 doc and lighttpd-angel SIGUSR1
lighttpd-angel:
add paranoid check to avoid sending kill(-1, <signal>) as root
Diffstat (limited to 'src/lighttpd-angel.c')
-rw-r--r-- | src/lighttpd-angel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lighttpd-angel.c b/src/lighttpd-angel.c index 4c629a64..2b88e554 100644 --- a/src/lighttpd-angel.c +++ b/src/lighttpd-angel.c @@ -38,12 +38,15 @@ static void sigaction_handler(int sig, siginfo_t *si, void *context) { switch (sig) { case SIGINT: case SIGTERM: + case SIGUSR1: + if (pid <= 0) break; memcpy(&last_sigterm_info, si, sizeof(*si)); /** forward the sig to the child */ kill(pid, sig); break; case SIGHUP: /** do a graceful restart */ + if (pid <= 0) break; memcpy(&last_sighup_info, si, sizeof(*si)); /** do a graceful shutdown on the main process and start a new child */ @@ -81,6 +84,7 @@ int main(int argc, char **argv) { sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); + sigaction(SIGUSR1, &act, NULL); sigaction(SIGHUP, &act, NULL); sigaction(SIGALRM, &act, NULL); sigaction(SIGCHLD, &act, NULL); |