reintroduced no orphans

This commit is contained in:
Unbit
2014-01-22 15:38:26 +01:00
parent ba1fb72427
commit 02e68ae578
2 changed files with 10 additions and 1 deletions
-1
View File
@@ -2046,7 +2046,6 @@ next:
uwsgi.has_emperor = 1;
uwsgi.emperor_fd = atoi(emperor_env);
uwsgi.master_process = 1;
uwsgi.no_orphans = 1;
uwsgi_log("*** has_emperor mode detected (fd: %d) ***\n", uwsgi.emperor_fd);
if (getenv("UWSGI_EMPEROR_FD_CONFIG")) {
+10
View File
@@ -3144,6 +3144,16 @@ int uwsgi_run() {
//from now on the process is a real worker
}
#if defined(__linux__) && defined(PR_SET_PDEATHSIG)
// avoid workers running without master at all costs !!! (dangerous)
if (uwsgi.master_process && uwsgi.no_orphans) {
if (prctl(PR_SET_PDEATHSIG, SIGKILL)) {
uwsgi_error("uwsgi_run()/prctl()");
}
}
#endif
// eventually maps (or disable) sockets for the worker
uwsgi_map_sockets();