mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 21:21:53 +00:00
reintroduced no orphans
This commit is contained in:
@@ -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")) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user