ksysguard: catch SIGTERM, SIGHUP and SIGINT from ksysgruardd

interesting thing is that there is a declaration of signalHandler()
function but it was nowhere to be found, what happened to it?

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-30 04:43:29 +03:00
parent ad62b07fea
commit 0883607c14

View file

@ -193,6 +193,13 @@ static void dropPrivileges( void )
}
}
void signalHandler( int sig )
{
log_error( "Signal caught: %d", sig );
signal(sig, SIG_DFL);
QuitApp = 1;
}
void makeDaemon( void )
{
int fd = -1;
@ -543,6 +550,10 @@ int main( int argc, char* argv[] )
initModules();
signal(SIGTERM, signalHandler);
signal(SIGHUP, signalHandler);
signal(SIGINT, signalHandler);
if ( RunAsDaemon ) {
makeDaemon();