unbound: Rewrite init script to use procd
authorMichael Hanselmann <public@hansmi.ch>
Fri, 10 Jun 2016 20:46:08 +0000 (22:46 +0200)
committerMichael Hanselmann <public@hansmi.ch>
Tue, 14 Jun 2016 20:09:31 +0000 (22:09 +0200)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
net/unbound/Makefile
net/unbound/files/unbound.init

index e5fbe43a2630bd0f28861a20096f05bcf3998bb1..e88c11e581e4f694c95f751cf8cb2e598a4f4d02 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
 PKG_VERSION:=1.5.9
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
index 4e700e445802d0ba897ad8b929f91dbf978f4f75..8c1304e2dde5953f1d15002acd98e5b1b7eb0419 100755 (executable)
@@ -1,14 +1,14 @@
 #!/bin/sh /etc/rc.common
-#Copyright (C) 2010 Ondrej Caletka <o.caletka@sh.cvut.cz>
+# Copyright (C) 2016 Michael Hanselmann
+
 START=61
 
-start () {
-       unbound
-}
+USE_PROCD=1
 
-stop () {
-       PIDFILE='/var/run/unbound.pid'
-       if [ -f $PIDFILE ] ; then
-               kill $(cat $PIDFILE)
-       fi
+start_service() {
+       procd_open_instance
+       procd_set_param command /usr/sbin/unbound
+       procd_append_param command -d # don't daemonize
+       procd_set_param respawn
+       procd_close_instance
 }