Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 3ba5bc3b609cfeefe54083215bc803fc > files > 3

pdns-2.9.22.5-1.mga1.src.rpm

--- pdns/pdns.in	2007-04-21 15:56:36.000000000 +0200
+++ pdns/pdns.in.oden	2008-05-21 12:25:47.000000000 +0200
@@ -1,6 +1,41 @@
 #!/bin/sh
-# chkconfig: - 80 75
-# description: PDNS is a versatile high performance authoritative nameserver
+#
+# powerdns This shell script takes care of starting and stopping powerdns.
+#
+# chkconfig: 345 80 75
+# description: PowerDNS is a versatile high performance \
+# authoritative nameserver
+# probe: true
+# processname: powerdns
+# pidfile: /var/run/powerdns/powerdns.pid
+# config: /etc/powerdns/pdns.conf
+
+# Comments to support LSB init script conventions
+### BEGIN INIT INFO
+# Provides: powerdns pdns
+# Required-Start: $network
+# Required-Stop: $network
+# Should-Start: mysqld postgresql ldap
+# Should-Stop: mysqld postgresql ldap
+# Default-Start:  3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start and stop PowerDNS
+# Description: PowerDNS is a versatile high performance \
+# authoritative nameserver.
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+[ -f /etc/powerdns/pdns.conf ] || exit 0
+
+[ -f /usr/sbin/pdns_server ] || exit 0
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
@@ -47,6 +82,7 @@
 		if test "$NOTRUNNING" = "0" 
 		then 
 			doPC quit
+			rm -f /var/lock/subsys/pdns
 			echo $ret
 		else
 			echo "not running"
@@ -57,6 +93,7 @@
 	force-stop)
 		echo -n "Stopping PowerDNS authoritative nameserver: "
 		killall -v -9 pdns_server
+		rm -f /var/lock/subsys/pdns
 		echo "killed"
 	;;
 
@@ -69,6 +106,7 @@
 			$pdns_server --daemon --guardian=yes
 			if test "$?" = "0"
 			then
+				touch /var/lock/subsys/pdns
 				echo "started"	
 			fi
 		fi