Well, I am not sending control+c to anyone, if it's working under uwsgi stack. The code simply listens most of the signals to terminate. And if it was run from the console, working in the foreground for development purposes, yes I press control+c to stop in my console. But not when it gets executed by another program. http://pastebin.com/TkqBSiyE
I think I have a clue here. It is about the emperor. See, it seems the master process is doing quite fine. It is just sending the proper quit signal to my script when it receives SIGHUP / SIGTERM or SIGINT: hu Jan 16 10:38:31 2014 - SIGINT/SIGQUIT received...killing workers... Thu Jan 16 10:38:31 2014 - [uwsgi-daemons] stopping daemon (pid: 15682): /path/to/python /path/to/runserver.py Bye bye! Bye bye! Thu Jan 16 10:38:33 2014 - worker 1 buried after 2 seconds Thu Jan 16 10:38:33 2014 - goodbye to uWSGI. Thu Jan 16 10:38:33 2014 - VACUUM: unix socket /tmp/app.sock removed. Thu Jan 16 10:38:36 2014 - *** Starting uWSGI 2.0.1 (64bit) on [Thu Jan 16 10:38:36 2014] *** .... I don't understand why do I get the "Bye bye!" message from my script twice but perhaps receiving 2 different signals from uwsgi, not that important. However, something seems wrong with the emperor. Only SIGHUP signal to emperor reloads masters gracefully so they kill their attaches too. But SIGTERM or SIGINT to emperor, kills the masters brutally and immediately. Therefore there is no master left to send any signal to my script: Thu Jan 16 10:50:20 2014 - uWSGI worker 1 screams: UAAAAAAH my master disconnected: i will kill myself !!! So my attached daemons hang on as zombies.. On Wed, Jan 15, 2014 at 8:10 PM, Roberto De Ioris <[email protected]> wrote: > > > I tried with the github source as you said only for socketio > > serve_forever: > > > > attach-daemon2 = cmd=/path/to/python > > /path/to/runserver.py,stopsignal=SIGINT,reloadsignal=SIGHUP > > > > http://pastebin.com/TkqBSiyE > > > > I wasn't sure for the signal names but these were the closest options I > > gave. It didn't show any progress and "reload" started to kill daemon > > brutally instead of gracefully. > > > > > --attach-daemon2 takes signal numbers (9 for KILL and so on) > > > > R > > > > For stopping and restarting, nothing seems changed: > > Wed Jan 15 14:40:26 2014 - [uwsgi-daemons] spawning "/path/to/python > > /path/to/runserver.py" (uid: 1000 gid: 1000) > > Server running on port :9100. Ctrl+C to quit > > == stop command here == > > Wed Jan 15 14:40:43 2014 - uWSGI worker 4 screams: UAAAAAAH my master > > disconnected: i will kill myself !!! > > Wed Jan 15 14:40:43 2014 - uWSGI worker 2 screams: UAAAAAAH my master > > disconnected: i will kill myself !!! > > Wed Jan 15 14:40:43 2014 - uWSGI worker 1 screams: UAAAAAAH my master > > disconnected: i will kill myself !!! > > Wed Jan 15 14:40:43 2014 - uWSGI worker 3 screams: UAAAAAAH my master > > disconnected: i will kill myself !!! > > > > and the process remains zombie.. By the way, this master app is run by > the > > emperor if it helps. > > > > wait, something here is wrong, are you sending control-c from the keyboard > ? > > it looks like your master is catching it as well as the daemon (and in > addition to this the master is abruptuly killed) > > Can you manually send SIGINT only to the master ? > > -- > Roberto De Ioris > http://unbit.it > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi >
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
