No problem. Including the users lists in case it helps someone else. On Tue, Jan 25, 2011 at 10:52 AM, Anton Koval' <[email protected]> wrote:
> Roger, you was totally right about file descriptor. > thanks a lot! > > > On Tue, Jan 25, 2011 at 8:08 PM, Roger Hoover <[email protected]>wrote: > >> Oh, I see. My guess is that supervisor is sending SIGTERM but you're not >> seeing it in the log b/c supervisord has already closed the file descriptors >> for those logs by the time you get the signal. >> >> In you're on Linux, try attaching to your sample program with strace after >> you've started it and I suspect that you'll see that it is catching SIGTERM. >> >> >> On Tue, Jan 25, 2011 at 10:01 AM, Anton Koval' <[email protected]>wrote: >> >>> hi Roger, thanks for answer. >>> Yes, i've catched SIGTERM signal, but i sent it from external program - >>> "htop" (monitoring tool on Linux-like systems, maybe Unix too). >>> And on process restarting by supervisorctl (like, supervisorctl restart >>> sample) i've catched nothing (as you can see, in supervisor.conf, for this >>> program i specified stopsignal = TERM) and that's the point of my problem. >>> >>> >>> On Tue, Jan 25, 2011 at 7:38 PM, Roger Hoover <[email protected]>wrote: >>> >>>> Hi Anton, >>>> >>>> I don't understand the problem. It looks like you are catching SIGTERM >>>> (which is 15). What do you want to happen that isn't? >>>> >>>> On Tue, Jan 25, 2011 at 7:57 AM, Anton Koval' <[email protected]>wrote: >>>> >>>>> Good days! >>>>> Today, have faced with the next problem - i'm unable to catch SIGTERM >>>>> signal from supervisor (on process restart), with python signal lib. Here >>>>> is >>>>> the sample code: >>>>> #program section in config >>>>> [program:sample] >>>>> command = /mnt/wrk/nimble/nimble-server/bin/sample >>>>> environment = >>>>> PYTHON_EGG_CACHE="/mnt/wrk/nimble/nimble-server/var/run/.eggs", >>>>> DJANGO_SETTINGS_MODULE="nimble.api.config.core.settings" >>>>> user = bgotw >>>>> startsecs = 2 >>>>> startretries = 3 >>>>> redirect_stderr = true >>>>> autostart = true >>>>> autorestart = true >>>>> redirect_stderr = true >>>>> stdout_logfile = /mnt/wrk/nimble/nimble-server/var/logs/sample.log >>>>> stdout_logfile_maxbytes = 5MB >>>>> stdout_logfile_backups = 10 >>>>> stopsignal = TERM >>>>> >>>>> /mnt/wrk/nimble/nimble-server/bin/sample calls next function: >>>>> def main(): >>>>> ''' >>>>> Main inintialisation and run >>>>> ''' >>>>> >>>>> def handle_quit(signum, frame): >>>>> log.debug("!!!!!!!!! %s" % str(signum)) >>>>> print signum, frame >>>>> >>>>> signal.signal(signal.SIGTERM, handle_quit) >>>>> signal.signal(signal.SIGINT, handle_quit) >>>>> signal.signal(signal.SIGABRT, handle_quit) >>>>> signal.signal(signal.SIGALRM, handle_quit) >>>>> signal.signal(signal.SIGBUS, handle_quit) >>>>> signal.signal(signal.SIGCHLD, handle_quit) >>>>> signal.signal(signal.SIGCLD, handle_quit) >>>>> signal.signal(signal.SIGCONT, handle_quit) >>>>> signal.signal(signal.SIGFPE, handle_quit) >>>>> signal.signal(signal.SIGHUP, handle_quit) >>>>> signal.signal(signal.SIGILL, handle_quit) >>>>> signal.signal(signal.SIGIO, handle_quit) >>>>> signal.signal(signal.SIGIOT, handle_quit) >>>>> signal.signal(signal.SIGPIPE, handle_quit) >>>>> signal.signal(signal.SIGPOLL, handle_quit) >>>>> signal.signal(signal.SIGPROF, handle_quit) >>>>> signal.signal(signal.SIGPWR, handle_quit) >>>>> signal.signal(signal.SIGQUIT, handle_quit) >>>>> signal.signal(signal.SIGRTMAX, handle_quit) >>>>> signal.signal(signal.SIGRTMIN, handle_quit) >>>>> signal.signal(signal.SIGSEGV, handle_quit) >>>>> #signal.signal(signal.SIGSTOP, handle_quit) >>>>> signal.signal(signal.SIGSYS, handle_quit) >>>>> signal.signal(signal.SIGTRAP, handle_quit) >>>>> signal.signal(signal.SIGTSTP, handle_quit) >>>>> signal.signal(signal.SIGTTIN, handle_quit) >>>>> signal.signal(signal.SIGTTOU, handle_quit) >>>>> signal.signal(signal.SIGURG, handle_quit) >>>>> signal.signal(signal.SIGUSR1, handle_quit) >>>>> signal.signal(signal.SIGUSR2, handle_quit) >>>>> signal.signal(signal.SIGVTALRM, handle_quit) >>>>> signal.signal(signal.SIGWINCH, handle_quit) >>>>> signal.signal(signal.SIGXCPU, handle_quit) >>>>> signal.signal(signal.SIGXFSZ, handle_quit) >>>>> #signal.signal(signal.SIG_DFL, handle_quit) >>>>> signal.signal(signal.SIG_IGN, handle_quit) >>>>> >>>>> import time >>>>> while True: >>>>> log.debug("????") >>>>> time.sleep(5) >>>>> >>>>> so: >>>>> 1. Make process "sample" restart with supervisorctl - nothing writes to >>>>> log (see handle_quit function); >>>>> 2. Start process "sample" with supervisorctl and then, sent SIGTERM to >>>>> process "sample", from htop - string "!!!!!!!!! 15" will appear in >>>>> log-file. >>>>> >>>>> any ideas? >>>>> thanks for your attention. >>>>> >>>>> _______________________________________________ >>>>> Supervisor-users mailing list >>>>> [email protected] >>>>> http://lists.supervisord.org/mailman/listinfo/supervisor-users >>>>> >>>>> >>>> >>> >> >
_______________________________________________ Supervisor-users mailing list [email protected] http://lists.supervisord.org/mailman/listinfo/supervisor-users
