Closed Finkman closed 2 years ago
As far as I recall the signals are not implicitly set up. The appropriate function needs to be called to setup the libraries signal handling. If you don't want to use said signal handling don't call the function.
In which cases is it required to call that function.
What is it purpose and how can we figure out if we should/shouldn't or must/mustn't call setupSignals
?
Well that's up to you. If your application is setting up signal handlers internally, don't call it. If you want to use the default signal handlers provided by the library, call it.
Our application, using the fastcgipp lib, was no longer handling the SIGTERM signal. After a long journey of debugging we found out, that the fastcgipp lib registers various of signal handler which overwrite our handlers. IMHO, that's a design flaw. Signals should be handled by the process, since it is the only why the catch crucial system events and messages.
Proposed Solution
Use concept of RAII and handle
instance::terminate
as a part of destruction process.