ipsec-tools: Use procd in racoon's init script
authorNoah Meyerhans <frodo@morgul.net>
Sat, 6 Dec 2014 16:50:37 +0000 (08:50 -0800)
committerNoah Meyerhans <frodo@morgul.net>
Sat, 6 Dec 2014 22:11:10 +0000 (14:11 -0800)
Signed-off-by: Noah Meyerhans <frodo@morgul.net>
net/ipsec-tools/files/racoon.init

index d539b363ffce66cb818418cdb0c5a9fd9bdd6e2a..bf5c1c3d609948788806729a3873263bdeb8a4f1 100644 (file)
@@ -1,17 +1,17 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2009-2011 OpenWrt.org
 # Copyright (C) 2011 Artem Makhutov
+# Copyright (C) 2014 Noah Meyerhans <frodo@morgul.net>
 
-START=49
-
-SERVICE_USE_PID=1
+USE_PROCD=1
 
-start() {
-       mkdir -m 0700 -p /var/racoon
-       [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf
-       service_start /usr/sbin/racoon -f /etc/racoon.conf
-}
+START=49
 
-stop() {
-       service_stop /usr/sbin/racoon
+start_service() {
+    mkdir -m 0700 -p /var/racoon
+    [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf
+    procd_open_instance
+    procd_set_param command /usr/sbin/racoon -F -f /etc/racoon/racoon.conf -l /var/log/racoon
+    procd_set_param respawn
+    procd_close_instance
 }