commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johnny Luong <>
Subject Re: signals in a Daemon?
Date Wed, 10 Mar 2010 21:51:28 GMT
Hash: SHA1

Denis Haskin wrote:
| Can someone shed some light here?
| I have a daemon implemented using commons daemon.  I've done it the
| recommend way, where the start() method of my daemon just fires off a
| which does the actual work.
| What I find a little surprising is that when I send the daemon a TERM
| signal, the stop() method gets called (as expected), but it really seems
| like a TERM signal is also delivered to my thread, since it exits
|  Ideally, I would like to: in the stop() method, set a flag for the thread
| so that when it finishes its current chunk of work, it will exit.
| It seems like jsvc is (as would be expected) putting in its own signal
| handling, and that is preventing me from being able to trap this
signal and
| prevent my thread from exiting abruptly.
| Is this not recommended behavior?  Any recommendations how to do this?
| Thanks,
| dwh

Hi Denis,

Does your stop method wait till all daemon threads are finished
executing?  If it does not, and the only threads remaining are Daemon
threads, then the JVM is just going to exit which might make it appear
that it has abruptly exited...

Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message