aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_os.h2
-rw-r--r--src/os/unix/ngx_posix_init.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/os/unix/ngx_os.h b/src/os/unix/ngx_os.h
index 161661253..90d253912 100644
--- a/src/os/unix/ngx_os.h
+++ b/src/os/unix/ngx_os.h
@@ -53,8 +53,8 @@ extern ngx_int_t ngx_process;
extern ngx_pid_t ngx_new_binary;
extern ngx_int_t ngx_inherited;
-extern ngx_int_t ngx_signal;
extern ngx_int_t ngx_reap;
+extern ngx_int_t ngx_timer;
extern ngx_int_t ngx_quit;
extern ngx_int_t ngx_terminate;
extern ngx_int_t ngx_noaccept;
diff --git a/src/os/unix/ngx_posix_init.c b/src/os/unix/ngx_posix_init.c
index 84c9c519b..b76a9af75 100644
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -42,6 +42,8 @@ ngx_signal_t signals[] = {
"SIG" ngx_value(NGX_CHANGEBIN_SIGNAL),
ngx_signal_handler },
+ { SIGALRM, "SIGALRM", ngx_signal_handler },
+
{ SIGINT, "SIGINT", ngx_signal_handler },
{ SIGCHLD, "SIGCHLD", ngx_signal_handler },
@@ -99,7 +101,6 @@ void ngx_signal_handler(int signo)
ngx_err_t err;
ngx_signal_t *sig;
- ngx_signal = 1;
ignore = 0;
err = ngx_errno;
@@ -172,6 +173,14 @@ void ngx_signal_handler(int signo)
action = ", changing binary";
break;
+ case SIGALRM:
+ if (!ngx_terminate) {
+ ngx_timer = 1;
+ action = ", shutting down old worker process";
+ }
+
+ break;
+
case SIGCHLD:
ngx_reap = 1;
break;