[nsd/f15] fix init script to also use root, not user nsd for the piddir
Paul Wouters
pwouters at fedoraproject.org
Tue Jun 7 14:23:34 UTC 2011
commit cd94c83a21d797c3e10c7cfe12c2d68758dd4ccd
Author: Paul Wouters <paul at xelerance.com>
Date: Tue Jun 7 10:22:45 2011 -0400
fix init script to also use root, not user nsd for the piddir
nsd.init | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/nsd.init b/nsd.init
index 51eb143..9b42669 100644
--- a/nsd.init
+++ b/nsd.init
@@ -24,6 +24,7 @@ NSD_PROG="/usr/sbin/nsd"
NSD_PIDFILE="/var/run/nsd/nsd.pid"
NSD_XFRDFILE="/var/lib/nsd/xfrd.state"
NSDC_PROG="/usr/sbin/nsdc"
+NSD_PIDDIR=`dirname $NSD_PIDFILE`
# Source function library.
. /etc/rc.d/init.d/functions
@@ -43,6 +44,8 @@ start() {
# Sanity checks.
[ -f $NSD_CONF ] || exit 5
[ -x $NSD_PROG ] || exit 5
+ # /var/run could (and should) be tmpfs
+ [ -d $NSD_PIDDIR ] || mkdir -p $NSD_PIDDIR
echo -n $"Starting nsd:"
$NSDC_PROG -c $NSD_CONF rebuild >/dev/null 2>&1
@@ -103,10 +106,10 @@ case "$1" in
[ -f /var/lock/subsys/nsd ] && restart || :
;;
status)
- $NSDC_PROG -c $NSD_CONF running
+ status -p $NSD_PIDFILE $NSD_PROG
;;
reload)
- echo -n $"Rebuilding zonfiles:"
+ echo -n $"Rebuilding zonefiles:"
$NSDC_PROG -c $NSD_CONF rebuild >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
More information about the scm-commits
mailing list