packages/net/unbound/files/unbound.init

51 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/sh /etc/rc.common
##############################################################################
#
# Copyright (C) 2016 Michael Hanselmann, Eric Luehrsen
#
##############################################################################
#
# This init script is just the entry point for Unbound UCI.
#
##############################################################################
START=60
USE_PROCD=1
PROG=/usr/sbin/unbound
##############################################################################
. /usr/lib/unbound/unbound.sh
##############################################################################
start_service() {
# WAIT! Unbound often takes its time writing closure stats to syslog
pidof $PROG && sleep 1
# complex UCI work
unbound_start
# standard procd clause
procd_open_instance
procd_set_param command $PROG -d -c $UNBOUND_CONFFILE
procd_set_param respawn
procd_close_instance
}
##############################################################################
stop_service() {
unbound_stop
}
##############################################################################
service_triggers() {
procd_add_reload_trigger "unbound"
procd_add_raw_trigger "interface.*" 2000 /etc/init.d/unbound restart
}
##############################################################################