diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-02-28 20:03:50 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-02-28 20:03:50 +0000 |
commit | 605eb95c6257651e644cb3ac9fed9ea23de19fef (patch) | |
tree | be1f25ebafe30224cc5e1b791146dcc67770a640 /dns/powerdns | |
parent | - Add missed qtext.so to pkg-plist, so it get packaged. (diff) |
- Add sample startup script
PR: ports/62344
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=102456
Diffstat (limited to 'dns/powerdns')
-rw-r--r-- | dns/powerdns/Makefile | 7 | ||||
-rw-r--r-- | dns/powerdns/files/pdns.sh.sample | 34 | ||||
-rw-r--r-- | dns/powerdns/pkg-plist | 1 |
3 files changed, 41 insertions, 1 deletions
diff --git a/dns/powerdns/Makefile b/dns/powerdns/Makefile index 5c3f6043ccda..640fa5c7d7e7 100644 --- a/dns/powerdns/Makefile +++ b/dns/powerdns/Makefile @@ -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 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ 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) @@ -125,5 +126,9 @@ post-install: ${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/ .endfor .endif +.if !exists(${STARTUP_SCRIPT}) + ${ECHO_MSG} "Installing ${STARTUP_SCRIPT} startup file." + ${INSTALL_SCRIPT} ${FILESDIR}/pdns.sh.sample ${STARTUP_SCRIPT} +.endif .include <bsd.port.post.mk> diff --git a/dns/powerdns/files/pdns.sh.sample b/dns/powerdns/files/pdns.sh.sample new file mode 100644 index 000000000000..d19be1bfd061 --- /dev/null +++ b/dns/powerdns/files/pdns.sh.sample @@ -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 diff --git a/dns/powerdns/pkg-plist b/dns/powerdns/pkg-plist index d1ee0f0b1b49..74c1eefe1f96 100644 --- a/dns/powerdns/pkg-plist +++ b/dns/powerdns/pkg-plist @@ -10,6 +10,7 @@ sbin/pdns_server %%RECURSOR%%sbin/pdns_recursor @unexec if cmp -s %D/etc/pdns.conf %D/etc/pdns.conf-dist; then rm -f %D/etc/pdns.conf; fi etc/pdns.conf-dist +etc/rc.d/pdns.sh.sample @exec [ -f %B/pdns.conf ] || cp %B/%f %B/pdns.conf %%PORTDOCS%%share/examples/powerdns/pdns.conf %%PORTDOCS%%share/examples/powerdns/pdns_mysql.sql |