diff options
author | pettai <pettai@pkgsrc.org> | 2015-03-09 11:34:26 +0000 |
---|---|---|
committer | pettai <pettai@pkgsrc.org> | 2015-03-09 11:34:26 +0000 |
commit | e6dd25b0059d3cbf5ce3d213985384a206351cfb (patch) | |
tree | 7cddc6d65275d9537d6e35c97c1648066dbfa3d3 /net | |
parent | 76f0e5608787322c6722380c782c158ab065b79d (diff) | |
download | pkgsrc-e6dd25b0059d3cbf5ce3d213985384a206351cfb.tar.gz |
update the rc-script so it works correctly for the nsd user
Diffstat (limited to 'net')
-rw-r--r-- | net/nsd/Makefile | 9 | ||||
-rw-r--r-- | net/nsd/files/nsd.sh | 24 |
2 files changed, 26 insertions, 7 deletions
diff --git a/net/nsd/Makefile b/net/nsd/Makefile index 16623432035..d9205f7627a 100644 --- a/net/nsd/Makefile +++ b/net/nsd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.73 2015/02/05 07:06:04 pettai Exp $ +# $NetBSD: Makefile,v 1.74 2015/03/09 11:34:26 pettai Exp $ DISTNAME= nsd-4.1.1 CATEGORIES= net @@ -9,7 +9,8 @@ HOMEPAGE= http://www.nlnetlabs.nl/nsd/index.html COMMENT= Authoritative-only DNS server LICENSE= modified-bsd -BUILD_DEFS+= VARBASE +BUILD_DEFS+= VARBASE NSD_USER NSD_GROUP +FILES_SUBST+= NSD_USER=${NSD_USER} NSD_GROUP=${NSD_GROUP} BUILDLINK_API_DEPENDS.openssl+= openssl>=0.9.7 @@ -40,7 +41,7 @@ CONFIGURE_ARGS+=--enable-ratelimit CONFIGURE_ARGS+=--disable-ratelimit .endif -CONFIGURE_ARGS+=--with-pidfile=${VARBASE}/run/nsd.pid +CONFIGURE_ARGS+=--with-pidfile=${VARBASE}/run/nsd/nsd.pid CONFIGURE_ARGS+=--with-user=${NSD_USER} CONFIGURE_ARGS+=--with-dbfile=${VARBASE}/nsd/nsd.db CONFIGURE_ARGS+=--with-xfrdfile=${VARBASE}/nsd/nsd-xfrd.state @@ -57,6 +58,8 @@ PKG_USERS= ${NSD_USER}:${NSD_GROUP} CONF_FILES+= share/examples/nsd/nsd.conf ${PKG_SYSCONFDIR}/nsd.conf +OWN_DIRS_PERMS+= ${VARBASE}/nsd ${NSD_USER} ${NSD_GROUP} 755 + INSTALLATION_DIRS= share/examples/nsd INSTALLATION_DIRS+= ${VARBASE}/nsd diff --git a/net/nsd/files/nsd.sh b/net/nsd/files/nsd.sh index f63cdd8b33f..4d79958501e 100644 --- a/net/nsd/files/nsd.sh +++ b/net/nsd/files/nsd.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: nsd.sh,v 1.3 2008/04/24 09:38:30 joerg Exp $ +# $NetBSD: nsd.sh,v 1.4 2015/03/09 11:34:26 pettai Exp $ # # PROVIDE: nsd # REQUIRE: DAEMON @@ -12,9 +12,25 @@ name="nsd" rcvar=${name} command=@PREFIX@/sbin/${name} -pidfile=/var/run/${name}.pid +pidfile=/var/run/${name}/${name}.pid +required_files="@PKG_SYSCONFDIR@/nsd.conf" +start_precmd="nsd_precmd" + +nsd_precmd() +{ + if [ ! -d @VARBASE@/run/nsd ]; then + @MKDIR@ @VARBASE@/run/nsd + @CHMOD@ 0750 @VARBASE@/run/nsd + @CHOWN@ @NSD_USER@:@NSD_GROUP@ @VARBASE@/run/nsd + fi +} nsd_flags=${nsd_flags:-""} -load_rc_config ${name} -run_rc_command "$1" +if [ -f /etc/rc.subr ]; then + load_rc_config ${name} + run_rc_command "$1" +else + echo -n " ${name}" + ${command} ${nsd_flags} +fi |