[omniORB] Catching SIGTERM/SIGHUP using omniORB v3.0

Mark Johnson mark.johnson@onfiber.com
Fri, 14 Sep 2001 15:07:04 -0500


ENV: Solaris 2.8, CC, omniORB3.0

I'm trying to catch SIGTERM and SIGHUP but I don't seem to be getting them.
Is there anything special that I need to do to get these to work? I tried to
see if any of the examples that came with the distribution came with an
example of using signals but all I found were ones for threading...

Typically, I do something like this:

#include <signal.h>
extern "C"
{
   void CloseController(int sig)
   {
      signal(sig, CloseController);
	// ... etc ... 
   }
   void ReloadController(int sig)
   {
      signal(sig, ReloadController);
	// ... etc ... 
   }
}
int main( int argc, char * argv[] )
{
	// ... etc ...
   signal( SIGTERM, CloseController );
   signal( SIGINT,  CloseController );
   signal( SIGHUP,  ReloadController );
	// ... etc ...

   return 0;
}