MXS-2057 systemd watchdog
Systemd wathdog notification at a little more than 2/3 of the systemd configured time. In the service config (maxscale.service) add e.g. WatchdogSec=30s to set and enable the watchdog. For building: install libsystemd-dev. The next commit will modify cmake configuration and code to conditionally compile the new code based on existence of libsystemd-dev.
This commit is contained in:
@ -27,6 +27,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <systemd/sd-daemon.h>
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
@ -1768,6 +1769,13 @@ int main(int argc, char** argv)
|
||||
cnf->log_target = MXB_LOG_TARGET_STDOUT;
|
||||
}
|
||||
|
||||
// Systemd watchdog. Must be called in the initial thread */
|
||||
uint64_t systemd_interval; // in microseconds
|
||||
if (sd_watchdog_enabled(false, &systemd_interval) > 0)
|
||||
{
|
||||
RoutingWorker::set_watchdog_interval(systemd_interval);
|
||||
}
|
||||
|
||||
if (!daemon_mode)
|
||||
{
|
||||
fprintf(stderr,
|
||||
|
Reference in New Issue
Block a user