On Fri, Oct 30, 2015 at 10:04:34AM +0100, Arturo Borrero Gonzalez wrote: > diff --git a/src/systemd.c b/src/systemd.c > new file mode 100644 > index 0000000..82f1dd5 > --- /dev/null > +++ b/src/systemd.c > @@ -0,0 +1,61 @@ > +/* > + * (C) 2015 by Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > + */ > + > +#include "systemd.h" > +#include "conntrackd.h" > +#include "alarm.h" > +#include <systemd/sd-daemon.h> > +#include <sys/types.h> > +#include <unistd.h> > + > +static struct alarm_block sd_watchdog; > +static uint64_t sd_watchdog_interval; > > +static void sd_ct_watchdog_alarm(struct alarm_block *a, void *data) > +{ > + sd_notify(0, "WATCHDOG=1"); > + add_alarm(&sd_watchdog, 0, sd_watchdog_interval); > +} > + > +void sd_ct_watchdog_init(void) > +{ > + /* ignoring systemd API erros: only care if admin expects watchdog */ Not sure what you mean with this comment. > + if (sd_watchdog_enabled(0, &sd_watchdog_interval) < 1) So sd_watchdog_enabled is setting sd_watchdog_interval? What is the value that sd_watchdog_interval is being set? > + return; > + > + /* from man page, recommended interval is half of set by admin */ > + sd_watchdog_interval = sd_watchdog_interval / 2; > + > + init_alarm(&sd_watchdog, &sd_watchdog_interval, sd_ct_watchdog_alarm); > + add_alarm(&sd_watchdog, 0, sd_watchdog_interval); > +} Let me know, thanks. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html