Commit 9167cdf1 authored by louiz’'s avatar louiz’

Notify systemd when the process is stopping

parent 9714d020
......@@ -16,6 +16,10 @@
# include <network/dns_handler.hpp>
#endif
#ifdef SYSTEMD_FOUND
# include <systemd/sd-daemon.h>
#endif
// A flag set by the SIGINT signal handler.
static volatile std::atomic<bool> stop(false);
// Flag set by the SIGUSR1/2 signal handler.
......@@ -136,6 +140,9 @@ int main(int ac, char** av)
if (stop)
{
log_info("Signal received, exiting...");
#ifdef SYSTEMD_FOUND
sd_notify(0, "STOPPING=1");
#endif
exiting = true;
stop.store(false);
xmpp_component->shutdown();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment