added --die-on-term

This commit is contained in:
roberto@maverick64
2011-05-19 20:35:47 +02:00
parent b3f3c5d7b3
commit 95432fd8e3
4 changed files with 11 additions and 3 deletions
+8 -2
View File
@@ -176,9 +176,15 @@ void master_loop(char **argv, char **environ) {
uwsgi_unix_signal(SIGHUP, grace_them_all);
uwsgi_unix_signal(SIGTERM, reap_them_all);
if (uwsgi.die_on_term) {
uwsgi_unix_signal(SIGTERM, kill_them_all);
uwsgi_unix_signal(SIGQUIT, reap_them_all);
}
else {
uwsgi_unix_signal(SIGTERM, reap_them_all);
uwsgi_unix_signal(SIGQUIT, kill_them_all);
}
uwsgi_unix_signal(SIGINT, kill_them_all);
uwsgi_unix_signal(SIGQUIT, kill_them_all);
uwsgi_unix_signal(SIGUSR1, stats);
+1 -1
View File
@@ -56,7 +56,7 @@ void uwsgi_systemd_init(char *systemd_socket) {
if (sun->sun_path[0] == '@') sun->sun_path[0] = 0;
msghdr = uwsgi_malloc(sizeof(struct msghdr));
memset(msghdr, sizeof(struct msghdr), 0);
memset(msghdr, 0, sizeof(struct msghdr));
msghdr->msg_iov = uwsgi_malloc(sizeof(struct iovec)*3);
memset(msghdr->msg_iov, 0, sizeof(struct iovec)*3);
+1
View File
@@ -68,6 +68,7 @@ UWSGI_DECLARE_EMBEDDED_PLUGINS static struct option long_base_options[] = {
{"vassals-inherit", required_argument, 0, LONG_ARGS_VASSALS_INHERIT},
{"reload-mercy", required_argument, 0, LONG_ARGS_RELOAD_MERCY},
{"exit-on-reload", no_argument, &uwsgi.exit_on_reload, 1},
{"die-on-term", no_argument, &uwsgi.die_on_term, 1},
{"help", no_argument, 0, 'h'},
{"usage", no_argument, 0, 'h'},
{"reaper", no_argument, 0, 'r'},
+1
View File
@@ -835,6 +835,7 @@ struct uwsgi_server {
unsigned int reloads;
int master_as_root;
int die_on_term;
int lazy;