made a note in TODO and signal handler about SIGHUP and boost asio in case of time...
[pingcheck] / src / main.cpp
index 9d27408..3c015ec 100644 (file)
@@ -389,7 +389,21 @@ void signal_handler_usr2(int param)
 }
 
 
-/// called regularly from io_service; checks signal_data.signal_flag
+/**
+ * @brief called regularly from io_service; checks signal_data.signal_flag
+ *
+ * this does NOT work if there is a change in system time -- boost asio's
+ *   deadline timers seem to operate on fixed time points on a non-monotonic
+ *   clock;
+ *
+ * We therefore use external programs to kill pingchecker processes if the
+ *   system clock changes; We use SIGHUP for this because it is not handled
+ *   here and thus the default signal handler (which just kills the process
+ *   without calling any destructors) avoids a freeze in here. SIGTERM would
+ *   not work any more after system time change!
+ *
+ * --> do not catch SIGHUP in any asio-related signal handling!
+ */
 void signal_checker( const boost::system::error_code &error )
 {
     bool want_stop = false;