Mon Jan 10 00:44:53 2011 UTC ()
Pull up following revision(s) (requested by tron in ticket #1519):
	etc/rc.d/named: revision 1.21
	etc/rc.d/named: revision 1.19
Adjust for new default location of the pid file.
handle new directory structure.


(riz)
diff -r1.18 -r1.18.32.1 src/etc/rc.d/named

cvs diff -r1.18 -r1.18.32.1 src/etc/rc.d/named (expand / switch to context diff)
--- src/etc/rc.d/named 2005/11/29 21:07:25 1.18
+++ src/etc/rc.d/named 2011/01/10 00:44:53 1.18.32.1
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: named,v 1.18 2005/11/29 21:07:25 christos Exp $
+# $NetBSD: named,v 1.18.32.1 2011/01/10 00:44:53 riz Exp $
 #
 
 # PROVIDE: named
@@ -13,7 +13,7 @@
 name="named"
 rcvar=$name
 command="/usr/sbin/${name}"
-pidfile="/var/run/${name}.pid"
+pidfile="/var/run/${name}/${name}.pid"
 start_precmd="named_precmd"
 extra_commands="reload"
 required_dirs="$named_chrootdir"	# if it is set, it must exist
@@ -114,7 +114,12 @@
 		cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \
 		    cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
 	fi
-	ln -fs "${named_chrootdir}${pidfile}" ${pidfile}
+
+	local piddir="$(dirname "${pidfile}")"
+	mkdir -p "${named_chrootdir}${piddir}" "${piddir}"
+	chmod 755 "${named_chrootdir}${piddir}" "${piddir}"
+	chown named:named "${named_chrootdir}${piddir}" "${piddir}"
+	ln -fs "${named_chrootdir}${pidfile}" "${pidfile}"
 
 	#	Change run_rc_commands()'s internal copy of $named_flags
 	#