[OpenWrt-Devel] [PATCH] conntrack-tools: add init script for conntrackd

Stijn Tintel stijn at linux-ipv6.be
Fri May 22 09:35:22 EDT 2015


Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/utils/conntrack-tools/Makefile          |  2 ++
 .../network/utils/conntrack-tools/files/conntrackd.init | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 package/network/utils/conntrack-tools/files/conntrackd.init

diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile
index 2c479c0..978467b 100644
--- a/package/network/utils/conntrack-tools/Makefile
+++ b/package/network/utils/conntrack-tools/Makefile
@@ -63,6 +63,8 @@ define Package/conntrack-tools/install
 		$(PKG_INSTALL_DIR)/usr/sbin/conntrack \
 		$(PKG_INSTALL_DIR)/usr/sbin/conntrackd \
 		$(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/conntrackd.init $(1)/etc/init.d/conntrackd
 endef
 
 $(eval $(call BuildPackage,conntrack-tools))
diff --git a/package/network/utils/conntrack-tools/files/conntrackd.init b/package/network/utils/conntrack-tools/files/conntrackd.init
new file mode 100644
index 0000000..a51eb88
--- /dev/null
+++ b/package/network/utils/conntrack-tools/files/conntrackd.init
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=21
+STOP=89
+
+USE_PROCD=1
+PROG="/usr/sbin/conntrackd"
+
+start_service() {
+	procd_open_instance
+
+	procd_set_param command $PROG -C /etc/conntrackd/conntrackd.conf
+	procd_set_param respawn
+
+	procd_close_instance
+}
-- 
2.0.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list