diff options
author | Pacho Ramos <pacho@gentoo.org> | 2014-04-05 08:23:38 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2014-04-05 08:23:38 +0000 |
commit | 0e31e30264f537d11b8efe5d13579cfbc3f47342 (patch) | |
tree | a31ce62f7eb58e623d86faf4d8bf13623da676a1 /net-dns | |
parent | Removing older, insecure versions (diff) | |
download | historical-0e31e30264f537d11b8efe5d13579cfbc3f47342.tar.gz historical-0e31e30264f537d11b8efe5d13579cfbc3f47342.tar.bz2 historical-0e31e30264f537d11b8efe5d13579cfbc3f47342.zip |
Add unit file and rely on tmpfiles.d to create needed cache dirs at runtime (#501876 by Martin Vath)
Package-Manager: portage-2.2.8-r1/cvs/Linux x86_64
Manifest-Sign-Key: 0xA188FBD4
Diffstat (limited to 'net-dns')
-rw-r--r-- | net-dns/pdnsd/ChangeLog | 9 | ||||
-rw-r--r-- | net-dns/pdnsd/Manifest | 22 | ||||
-rw-r--r-- | net-dns/pdnsd/files/pdnsd.rc8 | 28 | ||||
-rw-r--r-- | net-dns/pdnsd/files/pdnsd.service | 11 | ||||
-rw-r--r-- | net-dns/pdnsd/files/pdnsd.tmpfiles | 1 | ||||
-rw-r--r-- | net-dns/pdnsd/pdnsd-1.2.9a-r1.ebuild | 121 |
6 files changed, 177 insertions, 15 deletions
diff --git a/net-dns/pdnsd/ChangeLog b/net-dns/pdnsd/ChangeLog index fcec6801689e..34b1caf85929 100644 --- a/net-dns/pdnsd/ChangeLog +++ b/net-dns/pdnsd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-dns/pdnsd # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.122 2014/03/03 13:57:09 polynomial-c Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.123 2014/04/05 08:23:37 pacho Exp $ + +*pdnsd-1.2.9a-r1 (05 Apr 2014) + + 05 Apr 2014; Pacho Ramos <pacho@gentoo.org> +files/pdnsd.rc8, + +files/pdnsd.service, +files/pdnsd.tmpfiles, +pdnsd-1.2.9a-r1.ebuild: + Add unit file and rely on tmpfiles.d to create needed cache dirs at runtime + (#501876 by Martin Vath) 03 Mar 2014; Lars Wendler <polynomial-c@gentoo.org> files/pdnsd.rc7: Fixed pidfile location for non-linux systems. diff --git a/net-dns/pdnsd/Manifest b/net-dns/pdnsd/Manifest index 02b25620674b..e28d24f31a22 100644 --- a/net-dns/pdnsd/Manifest +++ b/net-dns/pdnsd/Manifest @@ -4,25 +4,19 @@ Hash: SHA256 AUX pdnsd.conf.test 377 SHA256 8ef1e68c43cefde86598158d2b624cbdd66d2436d681cabbc6327d34d5886058 SHA512 feec55fbdda4afe07e478eff6e2f5d1c62616ef0e90ae2dc7f3a39f2e005634ba917b6849fdd0cafc16d699cbac4575ec0d8acec3614c8dd92506384a91aa6e3 WHIRLPOOL 7cee62ec1905560c416f85ae00b0a8a90b67379016cad1b7431ebfb5705865577e27d6039e10af0483df2f3bce15850263ba89716122cb7568ce4b0ca3584548 AUX pdnsd.online.2 682 SHA256 eb771771c79a81608355c8f01ae595a35125d379fc6d502274dbc7f81685df8d SHA512 8c218673c22e3cde7fad3ddc49a90e6d7664e6a1c8c983eb7ad668179e4fbd8fa083c579ed87d48cad4a4c762f35b08df7de1fbf46c9b755c76d3a1ad7430924 WHIRLPOOL 47840e7b5701696d956ab47bc73ea7598f6eaf8df05c6569ffd20b51d05542aeb44628b26a58010e0ef57bf5d8f76a652ca168b0bdf311a46a8f9c38fff6e0df AUX pdnsd.rc7 727 SHA256 3b4e176ef37424b0ca5f3d951489af24c39ed18b8fe818212ed73af2c71b8a45 SHA512 d514264f9dfaabc41df4379e87334680bba09b4ab229c0a7688b58f2ae7eb3243e9fe2cc78a7b8ff1072ba8299724b560b9fc66a067afb43fc16d2cbb7a79d90 WHIRLPOOL 99e0af086b8cad096657d3ef55da42b95f0da26407525511d98defea34bb3abe224ad47d1781167b882321b4abc567bc6943535433d1c3f6fc7d9118b0a08f81 +AUX pdnsd.rc8 675 SHA256 e9b0bc2d0d0baf1e1268389e3746f277a49cd2187e553206d9db7be37e30d54e SHA512 fedd680f4ef60eca8bd754f24528c4d89b3927059d97d033392133cc463af74e577a12606df11f9004aab783e2c30a96e1d22bf969ed089189819b1e4e653756 WHIRLPOOL b0dedc2f8bd920f10f0ee45221f94f0cf05974f64adeb7ff034d066ed8fcc483ee01f9930c24e3ffe7f541541bd72778e5a5fe3bef757fc309b41cf50709a1e5 AUX pdnsd.resolvconf-r1 17538 SHA256 40bdcc876ba8bb86069d52f8023fed468974004f47c235c202ca7eac88aa0fe3 SHA512 22a92df825d560ec03860c1a9a6000f32e19b33ccda0f6412830ebca13499e6d45161267bb30658aa9ed4b5862bae04e304e25358c30ee6d80a9deea90ba989f WHIRLPOOL c6c08c105be3986d1d0c8b86d2cf9f0a36e2608b207ec3db084f46f55dd6f0764d999179133783ac055c75c14542d049f3240cb11036c162eeb5d820811ca3cb +AUX pdnsd.service 269 SHA256 c0db5c9844b3d882f8c6f22db839006f6616a0690b6bbd6bb4668207590f0e82 SHA512 c1504f52fb30ba197bd3c3450f200f2f274bf73f7a6436bc317ad9affc18e9c5edcb8555913a4aa9c6bf44b935e0c9cd005b4f5b0fd56eed6e11914f63db9ef2 WHIRLPOOL ed8fcdbe4acef862a3faff7322ff8fa4c2ed3923fe3931dfed6887425c52061132022c465f01082b4d76a2f15624ddb9b39886b766817897603853aed93abe1a +AUX pdnsd.tmpfiles 37 SHA256 db6537c715c0acfd47a4ca64fce3cbb29913705462a0abbb32fdabef38cdab52 SHA512 7beacc66e8504ca0f8e613dfc8ed2479362f1ebc98ffab902622b36c795fe75e176d9f0a330ad74e10a7f7b1597cce068d94eea6511a75b941e42b2458b76df5 WHIRLPOOL f785b6980c7e1748384a4f56f6744263ab28944e42b1741f7ebe1e3e6a5638b8fbcae5f0b4e9295127258908174bfb2ffdf9b01cd89e28d80017f2e156e25e5f DIST pdnsd-1.2.9a-par.tar.gz 516061 SHA256 bb5835d0caa8c4b31679d6fd6a1a090b71bdf70950db3b1d0cea9cf9cb7e2a7b SHA512 4fde296642306aa986ddb7cad0b5991bcd397656d93ef4962706276848c7fa62c664a40198e807d029637f116e8000c237d98b91cbbfec5c08b134d8bb3adf81 WHIRLPOOL 9f1f94d6aece1d5cdffe4799e532b1f88217e8d0fef83d097fd03a24a958ad551154efa1f1b719a31315be5e225f33cc7da5c40e3f13a0acba6686e0f6376573 +EBUILD pdnsd-1.2.9a-r1.ebuild 3802 SHA256 a6d337fe6a25952e8be8812e354c277dba8c9bdb0e159c02f1cd8a6159de6ef7 SHA512 b67e7ae6e53be5bf516f068a80a646254201d7b07c3e14bdd2442415648c833e1feaa8d40845c8752b638753a3a22df4480001b80aa228619a70d2b718e0abc3 WHIRLPOOL 0a3deaf6922830627eaadea890d11af457135a84ed356c136bd81102f9b8734dbd77aaa4a9f5e7af0bf138412da9f2e40aee39e2f58d83df222701efaf74a5be EBUILD pdnsd-1.2.9a.ebuild 3677 SHA256 b111b88061084cfbbc144d4d4340b542181792e95353eb6850af469c0e75137c SHA512 15faf2f5cda3d4eb690f8b9f3cf767741b33854bea5e61dc5f513906e962fcdf10917570b15d93a2cf3b1dc90d93d703b0d62ce1278e77b2e1c8fad2d1c100f5 WHIRLPOOL 837549ba0069d9cc49822f8faa8237e98df5cc692ffb0342aaa07e12e1fceb0478610da7f5922c093da47f571350d9ca03b027982cbd83ab0fcefff0d353593b -MISC ChangeLog 18654 SHA256 1096e358e68d679df298867a6b047999ec5f9815749bb200051d514ed7fae8a7 SHA512 24bc7829244f93b01abd6b643fa2019e108dd22a2791edb67a4f58acf525ad4cccad072f934325c128730a049884b52b23a32a8302c7590eefb78e4fc90fce3a WHIRLPOOL 40503104f8d757698af085d9b01764d81bb9fb34a03106a9fc0cdd7109452e27da41cf2288ce8945fc64c0a3c9d7eb9fe3aa6e3c316aff44ad86a9b100b67f9c +MISC ChangeLog 18921 SHA256 cc409f204785eb9a36c7f69ef75f8ce10ccbc77cf3ff8545db636a168c116546 SHA512 9313d9aa339a5597a9583b769097c41c559b3cdbbe07260e128aafa179f1d23bfae44e7a116cd1b58d3460b9667d1bd59eaa0adeeadddb6ea7a572db14136b1c WHIRLPOOL 30fb12fbd49e85066197b41c32718a6206cf5cdb2447cbf890655782d6cf0a5c7140485f87ff7c550ff93c378ac001d93870cc800600f1148bdccf008be46bf7 MISC metadata.xml 832 SHA256 3c197153f23083829e0a999a45a347df60829a03fd0bb3124e65943fcd00cbe8 SHA512 e8fc00a1d55acab6c01bc6fea75cb4271a8e1286666fdc639bb1cf9c7412ca0a8a92a97320e66ee821a2716d45378a977542265229f6c27fdf7e4bff286b5466 WHIRLPOOL 7c63c4f9292833e373011f578cba0a292b577c2492d57b17239b77a03438ea7251b65137a346baa74912dad10b7d5e9f60ce75a4ceea9b5daa5ed6251bbec396 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQIcBAEBCAAGBQJTFIo2AAoJEPiazRVxLXTFDC8QANP1D36uORBDBHaAImwJ2QIi -E/opsdvM1TAayPgiL9gSzg9R3ijOwysfx3nhBQjZHgYyWOsbUrBqIZMeKAFR+GYp -24WbI4fdWHJg87mSKeJ7U7uyOAPDjbF+PJOY/6sYudcg1dI9Gs819FYjxPDWGmOq -015lloNpy/Bf/vItcOEXUwuO7PP+PDUJ03WkA2WFBH5FrhOVnUNM3Xw7DDtUB5Z2 -RYrmj5wGkNKOkUBWqDq0aHsitNU7ZBUzYEbVwvwzRaWbBkq0cRJxpUg/dmNVIALa -c5DJlxwpaptmmkDSUfZzyHaiBbRF5VO2TmWJ1NClXwP95+MHgjuEV8+FfUBlhoXj -oh2goZ5pTvD7nN1qjZtnsJPwHVc21EsuS46xUmWPhHcVKNSjMRdpQrV3/PQsoh2S -Ppo2SmtdYo9gj04g8Ikp16vCOzXt15Yfe8ndoEX5xKHGkhDhOWQ41barTFIIMeM2 -ZZyQMMPkP5RJRYGp0P4ga3LhE+NAaq78wNBo+65fYuTInseFRaludaBz8ISkwyAn -Vvr+vrqcB8Xd9mHHzKbLCp+mUpMck0kaXotzMX6RivIyXYZevJlPvgz7aX0ZRoNd -LHKQlF5njsC2fINpiBeAs9AnSm6bXqR9FPTCeHxEPdacE5fq5RUkDSUuUIyHjgjt -qlI7rL0LCN+cPhotJ/7+ -=WJ4l +iEYEAREIAAYFAlM/vYoACgkQCaWpQKGI+9TKpgCffnVFLDX4sFjV3huPmUVZyLyU +LfMAnRGkH6C/ULKetS7nb43FFr6J2tOx +=szt0 -----END PGP SIGNATURE----- diff --git a/net-dns/pdnsd/files/pdnsd.rc8 b/net-dns/pdnsd/files/pdnsd.rc8 new file mode 100644 index 000000000000..b27d12bde004 --- /dev/null +++ b/net-dns/pdnsd/files/pdnsd.rc8 @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/files/pdnsd.rc8,v 1.1 2014/04/05 08:23:37 pacho Exp $ + +pidfile="/run/pdnsd.pid" +command="/usr/sbin/pdnsd" +command_args="-s -t -d -p ${pidfile} ${PDNSDCONFIG}" +extra_started_commands="reload" + +depend() { + use net + provide dns +} + +start_pre() { + if [ ! -e /etc/pdnsd/pdnsd.conf ] ; then + eerror "You need an /etc/pdnsd/pdnsd.conf file first." + eerror "There is a sample in /etc/pdnsd/pdnsd.conf.sample" + return 1 + fi +} + +reload() { + ebegin "Reloading pdnsd.conf" + /usr/sbin/pdnsd-ctl config + eend $? +} diff --git a/net-dns/pdnsd/files/pdnsd.service b/net-dns/pdnsd/files/pdnsd.service new file mode 100644 index 000000000000..d1812a53b384 --- /dev/null +++ b/net-dns/pdnsd/files/pdnsd.service @@ -0,0 +1,11 @@ +[Unit] +Description=pdnsd private name-server cache daemon +After=syslog.target network.target auditd.service +ConditionPathExists=/etc/pdnsd/pdnsd.conf + +[Service] +ExecStart=/usr/sbin/pdnsd -s -t +ExecReload=/usr/sbin/pdnsd-ctl config + +[Install] +WantedBy=multi-user.target diff --git a/net-dns/pdnsd/files/pdnsd.tmpfiles b/net-dns/pdnsd/files/pdnsd.tmpfiles new file mode 100644 index 000000000000..dc538151fe32 --- /dev/null +++ b/net-dns/pdnsd/files/pdnsd.tmpfiles @@ -0,0 +1 @@ +d /var/cache/pdnsd 750 pdnsd pdnsd - diff --git a/net-dns/pdnsd/pdnsd-1.2.9a-r1.ebuild b/net-dns/pdnsd/pdnsd-1.2.9a-r1.ebuild new file mode 100644 index 000000000000..b287960d2a3d --- /dev/null +++ b/net-dns/pdnsd/pdnsd-1.2.9a-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.9a-r1.ebuild,v 1.1 2014/04/05 08:23:37 pacho Exp $ + +EAPI=5 + +inherit systemd user + +DESCRIPTION="Proxy DNS server with permanent caching" +HOMEPAGE="http://members.home.nl/p.a.rombouts/pdnsd/" +SRC_URI="http://members.home.nl/p.a.rombouts/pdnsd/releases/${P}-par.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~s390 ~sparc ~x86" +IUSE="debug ipv6 isdn +urandom test" + +RDEPEND="sys-apps/openrc" +DEPEND="test? ( net-dns/bind-tools )" + +pkg_setup() { + enewgroup pdnsd + enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd +} + +src_configure() { + local myconf="" + use debug && myconf="${myconf} --with-debug=3" + use urandom && myconf="${myconf} --with-random-device=/dev/urandom" + + econf \ + --disable-dependency-tracking \ + --sysconfdir=/etc/pdnsd \ + --with-cachedir=/var/cache/pdnsd \ + --with-default-id=pdnsd \ + $(use_enable ipv6) $(use_enable ipv6 ipv6-startup) \ + $(use_enable isdn) \ + ${myconf} +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par + docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl} + docinto html ; dohtml doc/html/* + docinto txt ; dodoc doc/txt/* + newdoc doc/pdnsd.conf pdnsd.conf.sample + + newinitd "${FILESDIR}/pdnsd.rc8" pdnsd + newinitd "${FILESDIR}/pdnsd.online.2" pdnsd-online + systemd_newtmpfilesd "${FILESDIR}/pdnsd.tmpfiles" pdnsd.conf + systemd_dounit "${FILESDIR}/pdnsd.service" + + mkdir "${T}"/confd || die + + cat - > "${T}"/confd/pdnsd-online <<EOF +# Make sure to change the rc_need variable to the service for the +# interface that connects you to the dns servers. +# +# For instance if you use a PPP connection on ppp0 to connect, set +# rc_need="net.ppp0" + +rc_need="net.lo" +EOF + + # Don't try to do the smart thing and add the --help output here: + # it will cause the file to be etc-updated if the help text + # changes and fails when cross-compiling. + cat - > "${T}"/confd/pdnsd <<EOF +# Command line options, check pdnsd --help for a list of valid +# parameters. Note that most of the options that can be given at +# command-line are also available as configuration parameters in +# /etc/pdnsd/pdnsd.conf +PDNSDCONFIG="" +EOF + + doconfd "${T}"/confd/* + + # gentoo resolvconf support + exeinto /etc/resolvconf/update.d + newexe "${FILESDIR}/pdnsd.resolvconf-r1" pdnsd +} + +src_test() { + fail_kill() { + kill -9 $(<"${T}"/pid) + die "$1" + } + + mkdir "${T}/pdnsd" || die + echo -n -e "pd12\0\0\0\0" > "${T}/pdnsd/pdnsd.cache" + IPS=$(grep ^nameserver /etc/resolv.conf | sed -e 's/nameserver \(.*\)/\tip=\1;/g' | xargs) + sed -e "s/\tip=/${IPS}/" -e "s:cache_dir=:cache_dir=${T}/pdnsd:" "${FILESDIR}/pdnsd.conf.test" \ + > "${T}/pdnsd.conf.test" + src/pdnsd -c "${T}/pdnsd.conf.test" -g -s -d -p "${T}/pid" || die "couldn't start daemon" + sleep 3 + + find "${T}" -ls + [ -s "${T}/pid" ] || die "empty or no pid file created" + [ -S "${T}/pdnsd/pdnsd.status" ] || fail_kill "no socket created" + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || fail_kill "failed to start the daemon" + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || fail_kill "failed to communicate with the daemon" + sleep 3 + + dig @127.0.0.1 -p 33455 localhost > "${T}"/dig.output 2>&1 + cat "${T}"/dig.output || die + fgrep -q "status: NOERROR" "${T}"/dig.output || fail_kill "www.gentoo.org lookup failed" + + kill $(<"${T}/pid") || fail_kill "failed to terminate daemon" +} + +pkg_postinst() { + elog + elog "Add pdnsd to your default runlevel - rc-update add pdnsd default" + elog "" + elog "Add pdnsd-online to your online runlevel." + elog "The online interface will be listed in /etc/conf.d/pdnsd-online" + elog "" + elog "Sample config file in /etc/pdnsd/pdnsd.conf.sample" +} |