Re: Signal problem

2008-03-27 Thread Jeffrey Froman
Fabio Durieux Lopes wrote: > def signalHandler(signum, frame): > terminate = True This creates a new variable named "terminate" inside the signalHandler function's local scope. To adjust the value of a module-level global from inside a function, use the "global" keyword: def signalHandl

Re: Signal problem

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 16:27:16 -0300, Fabio Durieux Lopes <[EMAIL PROTECTED]> escribió: >On daemon.py I have: > > terminate = False > > def signalHandler(signum, frame): >terminate = True > >And my main loop goes like this: > >'while(not daemon.terminate):' > >When the signal t

Signal problem

2008-03-27 Thread Fabio Durieux Lopes
Hello again! Full of problems today! This one is about signal treatment. I made a daemon and set it to treat 2 signals: SIGALRM and SIGTERM. It goes like this: signal.signal(signal.SIGTERM, daemon.signalHandler) signal.signal(signal.SIGALRM, aFilter.alarmHandler) On daemon.py I

Re: Freebsd thread/signal problem

2005-02-10 Thread Andrew MacIntyre
snacktime wrote: This is on freebsd 5.3-release-p2 with python 2.4 and twisted both installed from ports. I tested it on Debian (sarge) and the signals work fine. I don't have a 5.x system usable at the moment, but last time I looked there were 3 possible threading options - the 4.x libc_r, libk

Freebsd thread/signal problem

2005-02-09 Thread snacktime
I have a client/server application written in python/twisted and on freebsd the server won't shut down correctly with SIGINT or SIGTERM, instead requiring a SIGKILL. The twist is that if I send the server a signal, it will shut down on the next request from the client. In that case it shuts down