ClemaX / ft_irc

Internet Relay Chat Server
0 stars 0 forks source link

Signal handling (for killer signals) #23

Closed pablo-lamtenzan closed 3 years ago

pablo-lamtenzan commented 3 years ago

The server must be able free it resources while interacting with the kernel signals. For handable signals (all except SIGKILL & SIGSTOP), that will force the process to end (e.g. SIGTERM, SIGHUP), handlers must be implemented. Currently default handler may cause leaks.

Too see:

ClemaX commented 3 years ago

SIGHUP may be useful for a configuration file reload functionality. @pablo-lamtenzan Do you know if it is safe to store the signal id in a global variable to handle specific signals? (The server needs to be restarted in case of SIGHUP).

pablo-lamtenzan commented 3 years ago

What you mean by signal id ? The integer taken as first param by signal ? Why you need to store this ?

ClemaX commented 3 years ago

We could restart the server in case of SIGHUP, so it would be useful to know which signal triggered a server-stop.

ClemaX commented 3 years ago

Fixed by #27 .