diff options
author | pettai <pettai@pkgsrc.org> | 2015-03-09 11:59:26 +0000 |
---|---|---|
committer | pettai <pettai@pkgsrc.org> | 2015-03-09 11:59:26 +0000 |
commit | 55c0e985d2e56d162b1725577ffd686a61777989 (patch) | |
tree | 553e5560f98fb1e0556b5b3b8215c3015caff243 /net/unbound | |
parent | c15a2b06fe44cf435ee1ff311fab8409c912cd33 (diff) | |
download | pkgsrc-55c0e985d2e56d162b1725577ffd686a61777989.tar.gz |
update the rc-script so it works correctly for the unbound user
Diffstat (limited to 'net/unbound')
-rw-r--r-- | net/unbound/Makefile | 7 | ||||
-rw-r--r-- | net/unbound/files/unbound.sh | 24 |
2 files changed, 25 insertions, 6 deletions
diff --git a/net/unbound/Makefile b/net/unbound/Makefile index 67c89ea65e2..6a0a8a6d4dd 100644 --- a/net/unbound/Makefile +++ b/net/unbound/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.34 2015/02/21 10:53:40 pettai Exp $ +# $NetBSD: Makefile,v 1.35 2015/03/09 11:59:26 pettai Exp $ DISTNAME= unbound-1.5.2 CATEGORIES= net @@ -9,13 +9,14 @@ HOMEPAGE= http://www.unbound.net/ COMMENT= DNS resolver and recursive server LICENSE= modified-bsd -BUILD_DEFS+= VARBASE +BUILD_DEFS+= VARBASE UNBOUND_USER UNBOUND_GROUP +FILES_SUBST+= UNBOUND_USER=${UNBOUND_USER} UNBOUND_GROUP=${UNBOUND_GROUP} GNU_CONFIGURE= yes USE_LIBTOOL= yes CONFIGURE_ARGS+= --with-libexpat=${BUILDLINK_PREFIX.expat} -CONFIGURE_ARGS+= --with-pidfile=${VARBASE}/run/unbound.pid +CONFIGURE_ARGS+= --with-pidfile=${VARBASE}/run/unbound/unbound.pid CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} CONFIGURE_ARGS+= --enable-allsymbols diff --git a/net/unbound/files/unbound.sh b/net/unbound/files/unbound.sh index a6b77dfd7c4..a249954bd57 100644 --- a/net/unbound/files/unbound.sh +++ b/net/unbound/files/unbound.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: unbound.sh,v 1.2 2009/11/24 01:08:06 roy Exp $ +# $NetBSD: unbound.sh,v 1.3 2015/03/09 11:59:26 pettai Exp $ # # PROVIDE: unbound # REQUIRE: DAEMON @@ -13,7 +13,25 @@ rcvar=${name} command=@PREFIX@/sbin/${name} pidfile=/var/run/${name}.pid +required_files="@PKG_SYSCONFDIR@/unbound.conf" extra_commands="reload" +start_precmd="unbound_precmd" -load_rc_config ${name} -run_rc_command "$1" +unbound_precmd() +{ + if [ ! -d @VARBASE@/run/unbound ]; then + @MKDIR@ @VARBASE@/run/unbound + @CHMOD@ 0750 @VARBASE@/run/unbound + @CHOWN@ @UNBOUND_USER@:@UNBOUND_GROUP@ @VARBASE@/run/unbound + fi +} + +unbound_flags=${unbound_flags:-""} + +if [ -f /etc/rc.subr ]; then + load_rc_config ${name} + run_rc_command "$1" +else + echo -n " ${name}" + ${command} ${nsd_flags} +fi |