Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2009 14:45:41 -0700 (PDT)
From:      Peter Steele <psteele@maxiscale.com>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        #freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Why would a kill -2 not work?
Message-ID:  <30551570.941242683137179.JavaMail.HALO$@halo>
In-Reply-To: <8116275.921242683067831.JavaMail.HALO$@halo>

next in thread | previous in thread | raw e-mail | index | archive | help
>The amount of stuff you're allowed to do safely in a signal handler is 
>pretty minimal-- you're better off setting a flag, returning from the 
>signal handler, and having the next run past the main event loop or 
>whatever check for the flag and handle things in a normal app 
>context. If you try to do anything involving malloc() or s/printf, 
>etc, you're running risks. "man sigaction" is likely to be 
>informative.... 

This is basically what we doing. When the handler is triggered we set a global variable to indicate the system is shutting down. I also signal a condition to wake up a sleeping thread. The lack of log messages indicate that this handler never gets called and the system carries on as if the kill -2 never happened. 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?30551570.941242683137179.JavaMail.HALO$>