conntrack-tools: add init script for conntrackd
authorJohn Crispin <john@openwrt.org>
Sat, 23 May 2015 15:28:56 +0000 (15:28 +0000)
committerJohn Crispin <john@openwrt.org>
Sat, 23 May 2015 15:28:56 +0000 (15:28 +0000)
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
SVN-Revision: 45737

package/network/utils/conntrack-tools/Makefile
package/network/utils/conntrack-tools/files/conntrackd.init [new file with mode: 0644]

index 2c479c0849c18d4edad8e00e8c2c5bc130f1d17e..978467b01657ea21c72e0fe1e6437432c1155e3e 100644 (file)
@@ -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 (file)
index 0000000..a51eb88
--- /dev/null
@@ -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
+}