[conntrack-tools,v2] systemd: default to use libsystemd if build with support for it

Message ID 152389972480.5571.3674659655291476973.stgit@endurance
State Accepted
Delegated to: Pablo Neira
Headers show
Series
  • [conntrack-tools,v2] systemd: default to use libsystemd if build with support for it
Related show

Commit Message

Arturo Borrero Gonzalez April 16, 2018, 5:28 p.m.
We may assume that if an user does build conntrackd with such feature, is with
the intention to use it. So, if that's the case, default to use it.

This eases some downstream use cases when dealing with default configs to
be shipped to final users.

This could be a mid-point solution, given some users are asking for a full
revert of commit c01d0d9138112ec95ee316385ea2687dd94fa4e3.

Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
---
 conntrackd.8                     |    5 +----
 conntrackd.conf.5                |    7 ++++---
 doc/stats/conntrackd.conf        |    2 +-
 doc/sync/alarm/conntrackd.conf   |    2 +-
 doc/sync/ftfw/conntrackd.conf    |    2 +-
 doc/sync/notrack/conntrackd.conf |    2 +-
 src/read_config_yy.y             |    4 ++++
 7 files changed, 13 insertions(+), 11 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso April 18, 2018, 1:58 p.m. | #1
On Mon, Apr 16, 2018 at 07:28:44PM +0200, Arturo Borrero Gonzalez wrote:
> We may assume that if an user does build conntrackd with such feature, is with
> the intention to use it. So, if that's the case, default to use it.
>
> This eases some downstream use cases when dealing with default configs to
> be shipped to final users.

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/conntrackd.8 b/conntrackd.8
index 6ccf261..de1e80c 100644
--- a/conntrackd.8
+++ b/conntrackd.8
@@ -1,4 +1,4 @@ 
-.TH CONNTRACKD 8 "Aug 30, 2016" "" ""
+.TH CONNTRACKD 8 "Apr 16, 2018" "" ""
 
 .\" Man page written by Pablo Neira Ayuso <pablo@netfilter.org> (Dec 2007)
 
@@ -149,9 +149,6 @@  the configuration file, ignore this notice.
 Starting with the 1.4.4 release, \fBconntrackd\fP includes integration with
 \fBsystemd(1)\fP to use an unit file of \fIType=notify\fP and watchdog support.
 
-The daemon should be configured at build time to include such support
-and \fBconntrackd.conf(5)\fP should contain \fBSystemd on\fP.
-
 .SH INCOMPATIBILITIES
 During the 0.9.9 development, some important changes in the replication message
 format were introduced. Therefore, \fBconntrackd\fP >= 0.9.9 will not work
diff --git a/conntrackd.conf.5 b/conntrackd.conf.5
index 7c5c29f..79a5bba 100644
--- a/conntrackd.conf.5
+++ b/conntrackd.conf.5
@@ -1,5 +1,5 @@ 
 .\"
-.\" (C) Copyright 2015, Arturo Borrero Gonzalez <arturo@debian.org>
+.\" (C) Copyright 2015-2018, Arturo Borrero Gonzalez <arturo@netfilter.org>
 .\"
 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
 .\" This is free documentation; you can redistribute it and/or
@@ -22,7 +22,7 @@ 
 .\" <http://www.gnu.org/licenses/>.
 .\" %%%LICENSE_END
 .\"
-.TH CONNTRACKD.CONF 5 "January 24, 2018"
+.TH CONNTRACKD.CONF 5 "Apr 16, 2018"
 
 .SH NAME
 conntrackd.conf \- configuration file for conntrackd daemon
@@ -476,7 +476,8 @@  Note: \fBsystemd(1)\fP watchdog is supported as well.
 
 Example: Systemd on
 
-By default runtime support is disabled.
+By default runtime support is enabled if conntrackd was built with the systemd
+feature. Otherwise is off.
 
 .TP
 .BI "Nice <value>"
diff --git a/doc/stats/conntrackd.conf b/doc/stats/conntrackd.conf
index ba957a1..9918bbb 100644
--- a/doc/stats/conntrackd.conf
+++ b/doc/stats/conntrackd.conf
@@ -6,7 +6,7 @@  General {
 	# Enable systemd support. If conntrackd is compiled with the proper
 	# configuration, you can use a systemd service unit of Type=notify
 	# and use conntrackd with systemd watchdog as well.
-	# Default is: off
+	# Default is: on if built with --enable-systemd, off otherwhise
 	#
 	#Systemd on
 
diff --git a/doc/sync/alarm/conntrackd.conf b/doc/sync/alarm/conntrackd.conf
index 831be15..b689ae6 100644
--- a/doc/sync/alarm/conntrackd.conf
+++ b/doc/sync/alarm/conntrackd.conf
@@ -221,7 +221,7 @@  General {
 	# Enable systemd support. If conntrackd is compiled with the proper
 	# configuration, you can use a systemd service unit of Type=notify
 	# and use conntrackd with systemd watchdog as well.
-	# Default is: off
+	# Default is: on if built using --enable-systemd, off otherwhise
 	#
 	#Systemd on
 
diff --git a/doc/sync/ftfw/conntrackd.conf b/doc/sync/ftfw/conntrackd.conf
index 9da0fb6..8267659 100644
--- a/doc/sync/ftfw/conntrackd.conf
+++ b/doc/sync/ftfw/conntrackd.conf
@@ -244,7 +244,7 @@  General {
 	# Enable systemd support. If conntrackd is compiled with the proper
 	# configuration, you can use a systemd service unit of Type=notify
 	# and use conntrackd with systemd watchdog as well.
-	# Default is: off
+	# Default is: on if built with --enable-systemd, off otherwhise
 	#
 	#Systemd on
 
diff --git a/doc/sync/notrack/conntrackd.conf b/doc/sync/notrack/conntrackd.conf
index 600fc89..8445b7d 100644
--- a/doc/sync/notrack/conntrackd.conf
+++ b/doc/sync/notrack/conntrackd.conf
@@ -283,7 +283,7 @@  General {
 	# Enable systemd support. If conntrackd is compiled with the proper
 	# configuration, you can use a systemd service unit of Type=notify
 	# and use conntrackd with systemd watchdog as well.
-	# Default is: off
+	# Default is: on if built with --enable-systemd, off otherwhise
 	#
 	#Systemd on
 
diff --git a/src/read_config_yy.y b/src/read_config_yy.y
index 32cca3c..6de8c6c 100644
--- a/src/read_config_yy.y
+++ b/src/read_config_yy.y
@@ -1626,6 +1626,10 @@  init_config(char *filename)
 	CONFIG(stats).syslog_facility = -1;
 	CONFIG(netlink).subsys_id = -1;
 
+#ifdef BUILD_SYSTEMD
+        CONFIG(systemd) = 1;
+#endif /* BUILD_SYSTEMD */
+
 	/* Initialize list of user-space helpers */
 	INIT_LIST_HEAD(&CONFIG(cthelper).list);