diff --git a/master.c b/master.c index 3545c83b..d69c14a8 100644 --- a/master.c +++ b/master.c @@ -19,11 +19,11 @@ void suspend_resume_them_all(int signum) { int suspend = 0; if (uwsgi.workers[0].suspended == 1) { - uwsgi_log_verbose("*** (SIGWINCH received) resuming workers ***\n"); + uwsgi_log_verbose("*** (SIGTSTP received) resuming workers ***\n"); uwsgi.workers[0].suspended = 0; } else { - uwsgi_log_verbose("*** PAUSE (press start to resume, if you do not have a joypad send SIGWINCH) ***\n"); + uwsgi_log_verbose("*** PAUSE (press start to resume, if you do not have a joypad send SIGTSTP) ***\n"); suspend = 1; uwsgi.workers[0].suspended = 1; } @@ -31,7 +31,7 @@ void suspend_resume_them_all(int signum) { for(i=1;i<=uwsgi.numproc;i++) { uwsgi.workers[i].suspended = suspend; if (uwsgi.workers[i].pid > 0) { - if (kill(uwsgi.workers[i].pid, SIGWINCH)) { + if (kill(uwsgi.workers[i].pid, SIGTSTP)) { uwsgi_error("kill()"); } } @@ -333,7 +333,7 @@ int master_loop(char **argv, char **environ) { uwsgi.current_time = time(NULL); - uwsgi_unix_signal(SIGWINCH, suspend_resume_them_all); + uwsgi_unix_signal(SIGTSTP, suspend_resume_them_all); uwsgi_unix_signal(SIGHUP, grace_them_all); if (uwsgi.die_on_term) { uwsgi_unix_signal(SIGTERM, kill_them_all); diff --git a/master_utils.c b/master_utils.c index 0caf3e58..527066c3 100644 --- a/master_utils.c +++ b/master_utils.c @@ -96,6 +96,7 @@ int uwsgi_respawn_worker(int wid) { if (pid == 0) { signal(SIGWINCH, worker_wakeup); + signal(SIGTSTP, worker_wakeup); uwsgi.mywid = wid; uwsgi.mypid = getpid(); uwsgi.workers[uwsgi.mywid].pid = uwsgi.mypid; diff --git a/utils.c b/utils.c index d961aa8f..c876c1fb 100644 --- a/utils.c +++ b/utils.c @@ -752,7 +752,7 @@ void wsgi_req_setup(struct wsgi_request *wsgi_req, int async_id, struct uwsgi_so if (uwsgi.workers[uwsgi.mywid].suspended == 1) { uwsgi_log_verbose("*** worker %d suspended ***\n", uwsgi.mywid); cycle: - // wait for some signal (normally SIGWINCH) or 10 seconds (as fallback) + // wait for some signal (normally SIGTSTP) or 10 seconds (as fallback) (void) poll(NULL, 0, 10*1000); if (uwsgi.workers[uwsgi.mywid].suspended == 1) goto cycle; uwsgi_log_verbose("*** worker %d resumed ***\n", uwsgi.mywid); diff --git a/uwsgi.c b/uwsgi.c index 892810ce..c2fc854c 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -3379,7 +3379,7 @@ static int manage_base_opt(int i, char *optarg) { signal_pidfile(SIGHUP, optarg); exit(0); case LONG_ARGS_PAUSE: - signal_pidfile(SIGWINCH, optarg); + signal_pidfile(SIGTSTP, optarg); exit(0); case LONG_ARGS_ATTACH_DAEMON: if (uwsgi.startup_daemons_cnt < MAX_DAEMONS) {