diff options
author | Phil Sutter <phil@nwl.cc> | 2015-07-26 01:34:54 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2015-07-26 10:36:35 +0200 |
commit | 6542f1d72d9eee897e5e7cf7c39bb10fb6a71cb5 (patch) | |
tree | a2fca6b7fa47593f0d8d67ff919d5c0b5916718a | |
parent | e8a2e04315d138863b743ff3f51af167cbcdae37 (diff) |
package/maradns: split into subpackages
For the nameserver alone, maradns is enough. fetchzone/zoneserver are
only used on authoritative/secondary servers, and askmara is just a
query tool probably not needed on embedded devices. Sadly, maradns
itself does not support recursion anymore. For that job, deadwood was
created.
Note that all these daemons don't properly fork into background.
Instead, the author maintains a daemonizing tool called 'duende', which
itself seems to have it's flaws, either. In practice, the deadwood init
script made rcS hang unless it was set to 'DAEMON' in rc.conf. Oh well.
Signed-off-by: Phil Sutter <phil@nwl.cc>
-rw-r--r-- | package/maradns/Makefile | 48 | ||||
-rw-r--r-- | package/maradns/files/deadwood.conffiles | 1 | ||||
-rw-r--r-- | package/maradns/files/deadwood.init | 32 | ||||
-rw-r--r-- | package/maradns/files/deadwood.postinst | 3 | ||||
-rw-r--r-- | package/maradns/files/dwood3rc | 10 | ||||
-rw-r--r-- | package/maradns/files/maradns.init | 4 | ||||
-rw-r--r-- | package/maradns/files/mararc | 3 | ||||
-rw-r--r-- | package/maradns/files/zoneserver.init | 32 | ||||
-rw-r--r-- | package/maradns/files/zoneserver.postinst | 3 |
9 files changed, 125 insertions, 11 deletions
diff --git a/package/maradns/Makefile b/package/maradns/Makefile index 524112900..df558019d 100644 --- a/package/maradns/Makefile +++ b/package/maradns/Makefile @@ -5,23 +5,37 @@ include ${ADK_TOPDIR}/rules.mk PKG_NAME:= maradns PKG_VERSION:= 2.0.09 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_HASH:= e1ee80836f0fbc47b9b94ec839e112ea19c40bed0b70d672d231849a4dea1083 PKG_DESCR:= small and secure DNS server PKG_SECTION:= net/dns -PKG_DEPENDS:= libpthread librt +PKG_DEPENDS:= libpthread librt duende PKG_URL:= http://www.maradns.org PKG_SITES:= http://maradns.samiam.org/download/2.0/${PKG_VERSION}/ PKG_NOPARALLEL:= 1 DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2 +PKG_SUBPKGS:= MARADNS DUENDE DEADWOOD ZONESERVER ASKMARA FETCHZONE +PKGSD_DUENDE:= maradns deamonising tool +PKGSD_DEADWOOD:= small and secure recursive DNS server +PKGSN_DEADWOOD:= duende +PKGSD_ZONESERVER:= maradns zone transfer daemon +PKGSN_ZONESERVER:= duende +PKGSD_ASKMARA:= maradns simple dns query tool +PKGSD_FETCHZONE:= maradns zone retrieval tool + PKG_FLAVOURS_MARADNS:= WITH_IPV6 PKGFD_WITH_IPV6:= enable IPv6 support include ${ADK_TOPDIR}/mk/package.mk $(eval $(call PKG_template,MARADNS,maradns,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,DUENDE,duende,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DUENDE},${PKG_SECTION})) +$(eval $(call PKG_template,DEADWOOD,deadwood,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DEADWOOD},${PKG_SECTION})) +$(eval $(call PKG_template,ZONESERVER,zoneserver,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_ZONESERVER},${PKG_SECTION})) +$(eval $(call PKG_template,ASKMARA,askmara,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_ASKMARA},${PKG_SECTION})) +$(eval $(call PKG_template,FETCHZONE,fetchzone,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FETCHZONE},${PKG_SECTION})) CONFIG_STYLE:= manual FAKE_FLAGS+= PREFIX="${WRKINST}/usr" \ @@ -40,12 +54,34 @@ do-configure: maradns-install: ${INSTALL_DIR} ${IDIR_MARADNS}/etc/maradns/logger - ${INSTALL_DIR} ${IDIR_MARADNS}/usr/bin ${IDIR_MARADNS}/usr/sbin + ${INSTALL_DIR} ${IDIR_MARADNS}/usr/sbin ${INSTALL_DATA} ./files/mararc ${IDIR_MARADNS}/etc/mararc ${INSTALL_DATA} ./files/sample.{zone,ptr} \ ${IDIR_MARADNS}/etc/maradns/ - ${CP} ${WRKINST}/usr/bin/{askmara,getzone} ${IDIR_MARADNS}/usr/bin/ - ${CP} ${WRKINST}/usr/sbin/{maradns,zoneserver} \ - ${IDIR_MARADNS}/usr/sbin/ + ${CP} ${WRKINST}/usr/sbin/maradns ${IDIR_MARADNS}/usr/sbin/ + +duende-install: + ${INSTALL_DIR} ${IDIR_DUENDE}/usr/bin + ${INSTALL_BIN} ${WRKINST}/usr/bin/duende ${IDIR_DUENDE}/usr/bin/ + +deadwood-install: + ${INSTALL_DIR} ${IDIR_DEADWOOD}/etc/maradns/logger + ${INSTALL_DIR} ${IDIR_DEADWOOD}/usr/sbin + ${INSTALL_DATA} ./files/dwood3rc ${IDIR_DEADWOOD}/etc/ + ${INSTALL_BIN} ${WRKINST}/usr/sbin/Deadwood \ + ${IDIR_DEADWOOD}/usr/sbin/ + +zoneserver-install: + ${INSTALL_DIR} ${IDIR_ZONESERVER}/usr/sbin + ${INSTALL_BIN} ${WRKINST}/usr/sbin/zoneserver \ + ${IDIR_ZONESERVER}/usr/sbin/ + +askmara-install: + ${INSTALL_DIR} ${IDIR_ASKMARA}/usr/bin + ${INSTALL_BIN} ${WRKINST}/usr/bin/askmara ${IDIR_ASKMARA}/usr/bin/ + +fetchzone-install: + ${INSTALL_DIR} ${IDIR_FETCHZONE}/usr/bin + ${INSTALL_BIN} ${WRKINST}/usr/bin/fetchzone ${IDIR_FETCHZONE}/usr/bin/ include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/maradns/files/deadwood.conffiles b/package/maradns/files/deadwood.conffiles new file mode 100644 index 000000000..ae8ce0df9 --- /dev/null +++ b/package/maradns/files/deadwood.conffiles @@ -0,0 +1 @@ +/etc/dwood3rc diff --git a/package/maradns/files/deadwood.init b/package/maradns/files/deadwood.init new file mode 100644 index 000000000..e40656635 --- /dev/null +++ b/package/maradns/files/deadwood.init @@ -0,0 +1,32 @@ +#!/bin/sh +#PKG deadwood +#INIT 50 + +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${deadwood:-NO}" = x"NO" && exit 0 + test x"$deadwood" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + [ -f /etc/dwood3rc ] || exit + [ -d /etc/maradns/logger ] || mkdir -p /etc/maradns/logger + /usr/bin/duende --pid=/var/run/dwood.pid /usr/sbin/Deadwood + ;; +stop) + kill $(</var/run/dwood.pid) + ;; +restart) + sh $0 stop + sleep 1 + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? diff --git a/package/maradns/files/deadwood.postinst b/package/maradns/files/deadwood.postinst new file mode 100644 index 000000000..fe2ba721b --- /dev/null +++ b/package/maradns/files/deadwood.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf deadwood NO diff --git a/package/maradns/files/dwood3rc b/package/maradns/files/dwood3rc new file mode 100644 index 000000000..4fed26411 --- /dev/null +++ b/package/maradns/files/dwood3rc @@ -0,0 +1,10 @@ +chroot_dir="/etc/maradns" +bind_address="0.0.0.0" +maradns_uid=65534 +maxprocs=5 +random_seed_file="/dev/urandom" +recursive_acl="192.168.1.0/24" +root_servers={} +root_servers["."]="198.41.0.4,128.9.0.107,192.33.4.12,128.8.10.90,192.203.230.10,192.5.5.241,192.112.36.4,128.63.2.53,192.36.148.17,192.58.128.30,193.0.14.129,198.32.64.12,202.12.27.33" +#upstream_servers={} +#upstream_servers["."]="" diff --git a/package/maradns/files/maradns.init b/package/maradns/files/maradns.init index 9b0e3b900..9ca23dc05 100644 --- a/package/maradns/files/maradns.init +++ b/package/maradns/files/maradns.init @@ -14,10 +14,10 @@ autostart) start) [ -f /etc/mararc ] || exit [ -d /etc/maradns/logger ] || mkdir -p /etc/maradns/logger - /usr/sbin/maradns & + /usr/bin/duende --pid=/var/run/maradns.pid /usr/sbin/maradns ;; stop) - kill $(pgrep -f /usr/sbin/maradns) + kill $(</var/run/maradns.pid) ;; restart) sh $0 stop diff --git a/package/maradns/files/mararc b/package/maradns/files/mararc index 29ab4fe8b..ae437af68 100644 --- a/package/maradns/files/mararc +++ b/package/maradns/files/mararc @@ -4,9 +4,6 @@ bind_address="0.0.0.0" maradns_uid=65534 maxprocs=5 random_seed_file="/dev/urandom" -recursive_acl="192.168.1.0/24" -root_servers={} -root_servers["."]="198.41.0.4,128.9.0.107,192.33.4.12,128.8.10.90,192.203.230.10,192.5.5.241,192.112.36.4,128.63.2.53,192.36.148.17,192.58.128.30,193.0.14.129,198.32.64.12,202.12.27.33" # uncomment these to set up real zones #csv1={} diff --git a/package/maradns/files/zoneserver.init b/package/maradns/files/zoneserver.init new file mode 100644 index 000000000..1c9f0d529 --- /dev/null +++ b/package/maradns/files/zoneserver.init @@ -0,0 +1,32 @@ +#!/bin/sh +#PKG zoneserver +#INIT 60 + +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${maradns:-NO}" = x"NO" && exit 0 + test x"$maradns" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + [ -f /etc/mararc ] || exit + [ -d /etc/maradns/logger ] || mkdir -p /etc/maradns/logger + /usr/bin/duende --pid=/var/run/zoneserver.pid /usr/sbin/zoneserver + ;; +stop) + kill $(</var/run/zoneserver.pid) + ;; +restart) + sh $0 stop + sleep 1 + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? diff --git a/package/maradns/files/zoneserver.postinst b/package/maradns/files/zoneserver.postinst new file mode 100644 index 000000000..f3a6b9a49 --- /dev/null +++ b/package/maradns/files/zoneserver.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf zoneserver NO |