From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [conntrackd PATCH 2/2 v2] conntrackd: add systemd support
Date: Fri, 6 Nov 2015 14:53:18 +0100 [thread overview]
Message-ID: <20151106135318.GA7657@salvia> (raw)
In-Reply-To: <144619584355.30622.12279676149815885959.stgit@r2d2.cica.es>
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@gmail.com>
> + *
> + * 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.
next prev parent reply other threads:[~2015-11-06 13:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 9:04 [conntrackd PATCH 2/2 v2] conntrackd: add systemd support Arturo Borrero Gonzalez
2015-11-06 13:53 ` Pablo Neira Ayuso [this message]
2015-11-06 15:59 ` Arturo Borrero Gonzalez
2015-11-11 15:59 ` Pablo Neira Ayuso
2015-11-11 18:18 ` Arturo Borrero Gonzalez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151106135318.GA7657@salvia \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).