Re: System signals

2012-04-30 Thread Sean Kelly
On Apr 30, 2012, at 8:42 AM, "H. S. Teoh" wrote: > On Mon, Apr 30, 2012 at 06:50:50AM -0700, Sean Kelly wrote: >> On Apr 29, 2012, at 9:28 PM, H. S. Teoh wrote: >> >>> On Sun, Apr 29, 2012 at 11:47:24PM +0200, deadalnix wrote: >>> [...] You misunderstood me (the sentence was not clear). I m

Re: System signals

2012-04-30 Thread H. S. Teoh
On Mon, Apr 30, 2012 at 06:50:50AM -0700, Sean Kelly wrote: > On Apr 29, 2012, at 9:28 PM, H. S. Teoh wrote: > > > On Sun, Apr 29, 2012 at 11:47:24PM +0200, deadalnix wrote: > > [...] > >> You misunderstood me (the sentence was not clear). I mean, you > >> cannot catch kill and the trick mentioned

Re: System signals

2012-04-30 Thread Sean Kelly
On Apr 29, 2012, at 9:28 PM, H. S. Teoh wrote: > On Sun, Apr 29, 2012 at 11:47:24PM +0200, deadalnix wrote: > [...] >> You misunderstood me (the sentence was not clear). I mean, you cannot >> catch kill and the trick mentioned int he link is linux specific. >> Obviously, the fact that you cannot c

Re: System signals

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 11:47:24PM +0200, deadalnix wrote: [...] > You misunderstood me (the sentence was not clear). I mean, you cannot > catch kill and the trick mentioned int he link is linux specific. > Obviously, the fact that you cannot catch kill isn't linux specific ;) Ah, I see. But real

Re: System signals

2012-04-29 Thread deadalnix
Le 29/04/2012 00:23, H. S. Teoh a écrit : On Sun, Apr 29, 2012 at 12:16:15AM +0200, deadalnix wrote: Le 28/04/2012 22:04, Andrea Fontana a écrit : How can i catch kill signal to gracefully shutdown my app? This can be used for other signals : http://www.deadalnix.me/2012/03/24/get-an-except

Re: System signals

2012-04-28 Thread Andrea Fontana
Of course I mean sigterm. I mixed sigterm and kill (not -9) utility and i wrote sigkill :) On Saturday, 28 April 2012 at 22:22:00 UTC, H. S. Teoh wrote: On Sun, Apr 29, 2012 at 12:16:15AM +0200, deadalnix wrote: But still, you can't catch kill and it is linux specific. AFAIK, SIGKILL cannot b

Re: System signals

2012-04-28 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 12:16:15AM +0200, deadalnix wrote: > Le 28/04/2012 22:04, Andrea Fontana a écrit : > >How can i catch kill signal to gracefully shutdown my app? > > > > This can be used for other signals : > http://www.deadalnix.me/2012/03/24/get-an-exception-from-a-segfault-on-linux-x86-

Re: System signals

2012-04-28 Thread deadalnix
Le 28/04/2012 22:04, Andrea Fontana a écrit : How can i catch kill signal to gracefully shutdown my app? This can be used for other signals : http://www.deadalnix.me/2012/03/24/get-an-exception-from-a-segfault-on-linux-x86-and-x86_64-using-some-black-magic/ But still, you can't catch kill a

Re: System signals

2012-04-28 Thread H. S. Teoh
On Sat, Apr 28, 2012 at 02:08:06PM -0700, Sean Kelly wrote: > On Apr 28, 2012, at 1:04 PM, "Andrea Fontana" > wrote: > > > How can i catch kill signal to gracefully shutdown my app? > > Gracefully? That's tough. I'd set a flag, then exit the signal > handler. All threads should periodically che

Re: System signals

2012-04-28 Thread Sean Kelly
On Apr 28, 2012, at 1:04 PM, "Andrea Fontana" wrote: > How can i catch kill signal to gracefully shutdown my app? Gracefully? That's tough. I'd set a flag, then exit the signal handler. All threads should periodically check the flag and throw an Error if they see it. Or an Exception you're su

System signals

2012-04-28 Thread Andrea Fontana
How can i catch kill signal to gracefully shutdown my app?