ports/62344: powerdns doesn't have a startscript
Ralf van der Enden
Ralf.vdEnden at wldelft.nl
Fri Feb 13 14:10:24 UTC 2004
The following reply was made to PR ports/62344; it has been noted by GNATS.
From: "Ralf van der Enden" <Ralf.vdEnden at wldelft.nl>
To: <freebsd-gnats-submit at freebsd.org>, <fbusse at gmx.de>
Cc:
Subject: Re: ports/62344: powerdns doesn't have a startscript
Date: Fri, 13 Feb 2004 15:00:40 +0100
The following patch adds a startup script for powerdns.
If the recursor exists it'll start it as well.
diff -ruN powerdns/Makefile powerdns/Makefile
--- powerdns/Makefile Wed Feb 4 06:19:56 2004
+++ powerdns/Makefile Fri Feb 13 12:54:14 2004
@@ -6,7 +6,7 @@
PORTNAME= powerdns
PORTVERSION= 2.9.15
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= dns ipv6
MASTER_SITES= http://downloads.powerdns.com/releases/
DISTNAME= pdns-${PORTVERSION}
@@ -27,6 +27,7 @@
DISTNAME="${DISTNAME}" \
POWERDNS_OPTIONS="${POWERDNS_OPTIONS}"
MAN8= pdns_control.8 pdns_server.8 zone2sql.8
+STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/pdns.sh.sample
# use user config if possible
.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
@@ -124,6 +125,10 @@
.for i in pdns.conf pdns_mysql.sql pdns_postgresql.sql
${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/
.endfor
+.endif
+.if !exists(${STARTUP_SCRIPT})
+ ${ECHO} "Installing ${STARTUP_SCRIPT} startup file."
+ ${INSTALL_SCRIPT} ${FILESDIR}/pdns.sh.sample ${STARTUP_SCRIPT}
.endif
.include <bsd.port.post.mk>
diff -ruN powerdns/Makefile.inc powerdns/Makefile.inc
--- powerdns/Makefile.inc Thu Feb 12 05:08:11 2004
+++ powerdns/Makefile.inc Thu Jan 1 01:00:00 1970
@@ -1 +0,0 @@
-WITH_POSTGRESQL_DRIVER=YES
diff -ruN powerdns/files/pdns.sh.sample powerdns/files/pdns.sh.sample
--- powerdns/files/pdns.sh.sample Thu Jan 1 01:00:00 1970
+++ powerdns/files/pdns.sh.sample Fri Feb 13 11:17:49 2004
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+rc_file=${0##*/}
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then
+ echo "${rc_file}: Cannot determine PREFIX." >&2
+ echo "Please use the complete pathname." >&2
+ exit 64
+fi
+
+pdns=${PREFIX}/sbin/pdns_server
+pdnscontrol=${PREFIX}/bin/pdns_control
+pdnsrecursor=${PREFIX}/sbin/pdns_recursor
+recursorpid=/var/run/pdns_recursor.pid
+
+# start
+if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
+ if [ -f $pdns ]; then
+ echo -n ' PowerDNS'
+ if [ -f $pdnsrecursor ]; then
+ $pdnsrecursor >/dev/null 2>&1
+ fi
+ $pdns
+ fi
+
+# stop
+elif [ "x$1" = "xstop" ]; then
+ if [ -f $pdnscontrol ]; then
+ $pdnscontrol quit
+ fi
+ if [ -r $recursorpid ]; then
+ kill `cat $recursorpid` >/dev/null
+ fi
+fi
More information about the freebsd-ports-bugs
mailing list