Bug 62344 - powerdns doesn't have a startscript
Summary: powerdns doesn't have a startscript
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-04 13:10 UTC by Fridtjof Busse
Modified: 2004-02-28 20:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fridtjof Busse 2004-02-04 13:10:05 UTC
It would be nice if powerdns would also install a initscript, at least I didn't find one after installation of 2.9.15 in /usr/local/etc/rc.d.

Fix: 

Include the startupscript that comes with pdns.
Comment 1 Kirill Ponomarev freebsd_committer freebsd_triage 2004-02-13 09:14:54 UTC
Hi,

On Wed, Feb 04, 2004 at 05:05:55AM -0800, Fridtjof Busse wrote:
> 
> >Number:         62344
> >Category:       ports
> >Synopsis:       powerdns doesn't have a startscript
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       low
> >Responsible:    freebsd-ports-bugs


Could you please review this PR ?

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/62344

-Kirill
Comment 2 Kirill Ponomarev freebsd_committer freebsd_triage 2004-02-13 09:14:58 UTC
State Changed
From-To: open->feedback

Asked for maintainer's review.
Comment 3 Ralf.vdEnden 2004-02-13 14:00:40 UTC
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
Comment 4 Ralf van der Enden 2004-02-16 19:13:05 UTC
Hello freebsd-gnats-submit,

  The previous patch was sent from work so the email address was
  different then the one known to GNATS. Sorry about that. It can be
  commited to the ports tree.

-- 
Best regards,
 Ralf                          mailto:tremere@cainites.net
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2004-02-28 20:03:55 UTC
State Changed
From-To: feedback->closed

Committed, thanks!