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.
This commit is contained in:
parent
6719db829b
commit
71ea33a239
1
sources
1
sources
@ -1,2 +1 @@
|
|||||||
43586f18b4d917887c92a35ff460c923 unbound-1.1.1.tar.gz
|
|
||||||
2517f811ec4939c0ea602c99a6fdea23 unbound-1.2.0.tar.gz
|
2517f811ec4939c0ea602c99a6fdea23 unbound-1.2.0.tar.gz
|
||||||
|
@ -25,6 +25,7 @@ exec="/usr/sbin/unbound"
|
|||||||
config="/etc/unbound/unbound.conf"
|
config="/etc/unbound/unbound.conf"
|
||||||
rootdir="/var/lib/unbound"
|
rootdir="/var/lib/unbound"
|
||||||
pidfile="/var/run/unbound/unbound.pid"
|
pidfile="/var/run/unbound/unbound.pid"
|
||||||
|
piddir=`dirname $pidfile`
|
||||||
|
|
||||||
[ -e /etc/sysconfig/unbound ] && . /etc/sysconfig/unbound
|
[ -e /etc/sysconfig/unbound ] && . /etc/sysconfig/unbound
|
||||||
|
|
||||||
@ -33,6 +34,8 @@ lockfile=/var/lock/subsys/unbound
|
|||||||
start() {
|
start() {
|
||||||
[ -x $exec ] || exit 5
|
[ -x $exec ] || exit 5
|
||||||
[ -f $config ] || exit 6
|
[ -f $config ] || exit 6
|
||||||
|
# /var/run could (and should) be tmpfs
|
||||||
|
[ -d $piddir ] || mkdir $piddir
|
||||||
|
|
||||||
if [ ! -f /etc/unbound/unbound_control.key ]
|
if [ ! -f /etc/unbound/unbound_control.key ]
|
||||||
then
|
then
|
||||||
@ -46,7 +49,7 @@ start() {
|
|||||||
echo -n $"Starting unbound: "
|
echo -n $"Starting unbound: "
|
||||||
|
|
||||||
# if not running, start it up here
|
# if not running, start it up here
|
||||||
daemon $exec
|
daemon --pidfile=$pidfile $exec
|
||||||
retval=$?
|
retval=$?
|
||||||
[ $retval -eq 0 ] && touch $lockfile
|
[ $retval -eq 0 ] && touch $lockfile
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user