From 71ea33a239cd6340f034fb3a301900e4f54177f0 Mon Sep 17 00:00:00 2001 From: Paul Wouters Date: Mon, 26 Jan 2009 23:02:22 +0000 Subject: [PATCH] Added support to init script for when /var/run is mounted as tmpfs, and /var/run/unbound does not exist. Also fixed daemon call to supply the pidfile (since it is in a subdir and not straight in /var/run. --- sources | 1 - unbound.init | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 841a3c6..3f41085 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -43586f18b4d917887c92a35ff460c923 unbound-1.1.1.tar.gz 2517f811ec4939c0ea602c99a6fdea23 unbound-1.2.0.tar.gz diff --git a/unbound.init b/unbound.init index 3df6048..db1b3d3 100644 --- a/unbound.init +++ b/unbound.init @@ -25,6 +25,7 @@ exec="/usr/sbin/unbound" config="/etc/unbound/unbound.conf" rootdir="/var/lib/unbound" pidfile="/var/run/unbound/unbound.pid" +piddir=`dirname $pidfile` [ -e /etc/sysconfig/unbound ] && . /etc/sysconfig/unbound @@ -33,6 +34,8 @@ lockfile=/var/lock/subsys/unbound start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 + # /var/run could (and should) be tmpfs + [ -d $piddir ] || mkdir $piddir if [ ! -f /etc/unbound/unbound_control.key ] then @@ -46,7 +49,7 @@ start() { echo -n $"Starting unbound: " # if not running, start it up here - daemon $exec + daemon --pidfile=$pidfile $exec retval=$? [ $retval -eq 0 ] && touch $lockfile echo