Mon Mar 9 11:59:26 2015 UTC ()
update the rc-script so it works correctly for the unbound user


(pettai)
diff -r1.34 -r1.35 pkgsrc/net/unbound/Makefile
diff -r1.2 -r1.3 pkgsrc/net/unbound/files/unbound.sh

cvs diff -r1.34 -r1.35 pkgsrc/net/unbound/Makefile (expand / switch to unified diff)

--- pkgsrc/net/unbound/Makefile 2015/02/21 10:53:40 1.34
+++ pkgsrc/net/unbound/Makefile 2015/03/09 11:59:26 1.35
@@ -1,31 +1,32 @@ @@ -1,31 +1,32 @@
1# $NetBSD: Makefile,v 1.34 2015/02/21 10:53:40 pettai Exp $ 1# $NetBSD: Makefile,v 1.35 2015/03/09 11:59:26 pettai Exp $
2 2
3DISTNAME= unbound-1.5.2 3DISTNAME= unbound-1.5.2
4CATEGORIES= net 4CATEGORIES= net
5MASTER_SITES= http://www.unbound.net/downloads/ 5MASTER_SITES= http://www.unbound.net/downloads/
6 6
7MAINTAINER= pettai@NetBSD.org 7MAINTAINER= pettai@NetBSD.org
8HOMEPAGE= http://www.unbound.net/ 8HOMEPAGE= http://www.unbound.net/
9COMMENT= DNS resolver and recursive server 9COMMENT= DNS resolver and recursive server
10LICENSE= modified-bsd 10LICENSE= modified-bsd
11 11
12BUILD_DEFS+= VARBASE 12BUILD_DEFS+= VARBASE UNBOUND_USER UNBOUND_GROUP
 13FILES_SUBST+= UNBOUND_USER=${UNBOUND_USER} UNBOUND_GROUP=${UNBOUND_GROUP}
13 14
14GNU_CONFIGURE= yes 15GNU_CONFIGURE= yes
15USE_LIBTOOL= yes 16USE_LIBTOOL= yes
16 17
17CONFIGURE_ARGS+= --with-libexpat=${BUILDLINK_PREFIX.expat} 18CONFIGURE_ARGS+= --with-libexpat=${BUILDLINK_PREFIX.expat}
18CONFIGURE_ARGS+= --with-pidfile=${VARBASE}/run/unbound.pid 19CONFIGURE_ARGS+= --with-pidfile=${VARBASE}/run/unbound/unbound.pid
19CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} 20CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE}
20CONFIGURE_ARGS+= --enable-allsymbols 21CONFIGURE_ARGS+= --enable-allsymbols
21 22
22# Add the same logic as for ldns, so sha2/gost is configured automatically 23# Add the same logic as for ldns, so sha2/gost is configured automatically
23CHECK_BUILTIN.openssl= yes 24CHECK_BUILTIN.openssl= yes
24.include "../../security/openssl/builtin.mk" 25.include "../../security/openssl/builtin.mk"
25CHECK_BUILTIN.openssl= no 26CHECK_BUILTIN.openssl= no
26.include "../../security/openssl/buildlink3.mk" 27.include "../../security/openssl/buildlink3.mk"
27 28
28PLIST_VARS+= sha2 gost 29PLIST_VARS+= sha2 gost
29.if defined(USE_BUILTIN.openssl) && !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) 30.if defined(USE_BUILTIN.openssl) && !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
30PLIST_VARS.gost!= \ 31PLIST_VARS.gost!= \
31 if ${PKG_ADMIN} pmatch 'openssl>=1.0.0' ${BUILTIN_PKG.openssl:Q}; then \ 32 if ${PKG_ADMIN} pmatch 'openssl>=1.0.0' ${BUILTIN_PKG.openssl:Q}; then \

cvs diff -r1.2 -r1.3 pkgsrc/net/unbound/files/unbound.sh (expand / switch to unified diff)

--- pkgsrc/net/unbound/files/unbound.sh 2009/11/24 01:08:06 1.2
+++ pkgsrc/net/unbound/files/unbound.sh 2015/03/09 11:59:26 1.3
@@ -1,19 +1,37 @@ @@ -1,19 +1,37 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: unbound.sh,v 1.2 2009/11/24 01:08:06 roy Exp $ 3# $NetBSD: unbound.sh,v 1.3 2015/03/09 11:59:26 pettai Exp $
4# 4#
5# PROVIDE: unbound 5# PROVIDE: unbound
6# REQUIRE: DAEMON 6# REQUIRE: DAEMON
7# 7#
8 8
9. /etc/rc.subr 9. /etc/rc.subr
10 10
11name="unbound" 11name="unbound"
12rcvar=${name} 12rcvar=${name}
13 13
14command=@PREFIX@/sbin/${name} 14command=@PREFIX@/sbin/${name}
15pidfile=/var/run/${name}.pid 15pidfile=/var/run/${name}.pid
 16required_files="@PKG_SYSCONFDIR@/unbound.conf"
16extra_commands="reload" 17extra_commands="reload"
 18start_precmd="unbound_precmd"
17 19
18load_rc_config ${name} 20unbound_precmd()
19run_rc_command "$1" 21{
 22 if [ ! -d @VARBASE@/run/unbound ]; then
 23 @MKDIR@ @VARBASE@/run/unbound
 24 @CHMOD@ 0750 @VARBASE@/run/unbound
 25 @CHOWN@ @UNBOUND_USER@:@UNBOUND_GROUP@ @VARBASE@/run/unbound
 26 fi
 27}
 28
 29unbound_flags=${unbound_flags:-""}
 30
 31if [ -f /etc/rc.subr ]; then
 32 load_rc_config ${name}
 33 run_rc_command "$1"
 34else
 35 echo -n " ${name}"
 36 ${command} ${nsd_flags}
 37fi