Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501876 - net-dns/pdnsd-1.2.9a: [PATCH] Please support/provide compatibility with systemd and maybe other init systems
Summary: net-dns/pdnsd-1.2.9a: [PATCH] Please support/provide compatibility with syste...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-20 10:15 UTC by Martin Väth
Modified: 2014-04-05 08:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/usr/lib/tmpfiles.d/pdnsd.conf (pdnsd.conf,37 bytes, text/plain)
2014-02-20 10:15 UTC, Martin Väth
Details
Patch for /etc/init.d/pdnsd (pdnsd.initd.patch,556 bytes, patch)
2014-02-20 10:16 UTC, Martin Väth
Details | Diff
pdnsd.service unit (pdnsd.service,269 bytes, text/plain)
2014-02-20 10:17 UTC, Martin Väth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Väth 2014-02-20 10:15:13 UTC
Created attachment 370868 [details]
/usr/lib/tmpfiles.d/pdnsd.conf

The script /etc/init.d/pdnsd currently "manually" generates the directory /var/cache/pdnsd

The "modern" way to do this is to declare this directory in
/usr/lib/tmpfiles.d/pdnsd.conf
and to rely on openrc/systemd/whatever to generate it.

This not only simplifies the code for openrc but also provides a better compatibility with systemd and other init systems which provide support for tmpfiles.d

When you are at it, maybe the obsolete /var/run location could also be changed to the modern location /run

In addition, perhaps also a systemd unit could be added (with "inherit systemd" and "systemd_dounit pdnsd.service") so that systemd users can use pdnsd out-of-the-box.

I attach the file for /usr/lib/tmpfiles.d, a patch for the initrd script, and a systemd unit pdnsd.service.

Note that in contrast to some pdnsd.service files which can be found on the net, the attached unit follows gentoo's systemd policy to let the daemon be controlled directly by systemd instead of forking to the background.
Comment 1 Martin Väth 2014-02-20 10:16:17 UTC
Created attachment 370870 [details, diff]
Patch for /etc/init.d/pdnsd
Comment 2 Martin Väth 2014-02-20 10:17:51 UTC
Created attachment 370872 [details]
pdnsd.service unit
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-02-20 10:27:12 UTC
(In reply to Martin Väth from comment #0)
> When you are at it, maybe the obsolete /var/run location could also be
> changed to the modern location /run

Pidfile location in the init script has already been fixed (although without a revbump). 

@systemd maintainers:
I'm not really a fan of this tmpfiles.d stuff so if not absolutely needed by systemd please don't implement it... modern != better
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-02-20 10:35:04 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #3)
> (In reply to Martin Väth from comment #0)
> > When you are at it, maybe the obsolete /var/run location could also be
> > changed to the modern location /run
> 
> Pidfile location in the init script has already been fixed (although without
> a revbump). 
> 
> @systemd maintainers:
> I'm not really a fan of this tmpfiles.d stuff so if not absolutely needed by
> systemd please don't implement it... modern != better

no, but unified = better. why have 2 ways of creating the directories when both systemd and openrc support tmpfiles.d?
Comment 5 Martin Väth 2014-02-20 11:55:31 UTC
> modern != better

I completely agree with this (in fact, I am really not happy about systemd).

However, tmpfiles.d makes sense not only because it is the "modern" standard; there is a reason why it is supported by openrc and why distributions like debian currently support it also for other init-systems:
It is somewhat a consequence of introducing /run as a volatile directory.

Indeed, it makes sense to fill the directory layout of /run directly at boot time in one task instead of running redundant tests every time the pdnsd service is restarted (e.g. when you have to switch between several name service providers).
Comment 6 Pacho Ramos gentoo-dev 2014-02-20 20:43:40 UTC
I also really prefer to use tmpfiles.d :/
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-02-20 21:22:44 UTC
(In reply to Pacho Ramos from comment #6)
> I also really prefer to use tmpfiles.d :/

Then doit... -.-
Comment 8 Pacho Ramos gentoo-dev 2014-03-30 19:21:56 UTC
/usr/sbin/pdnsd (called from your suggested unit file) is not installed at least with:
[ebuild   R    ] net-dns/pdns-3.3.1  USE="ldap {test} -botan -cryptopp -debug -doc -lua -mydns -mysql -odbc -opendbx -postgres -remote -remote-http -sqlite -static -tinydns -tools" 0 kB
Comment 9 Martin Väth 2014-03-30 19:44:03 UTC
(In reply to Pacho Ramos from comment #8)
>
> [ebuild   R    ] net-dns/pdns-3.3.1  USE="ldap {test} -botan -cryptopp
> -debug -doc -lua -mydns -mysql -odbc -opendbx -postgres -remote -remote-http
> -sqlite -static -tinydns -tools" 0 kB

The file I attached is for the latest version in the portage tree (which is 1.2.9a). The version you list above is not in the portage tree and has much more useflags than the one in the portage tree.

If the ebuild you list does not install pdnsd, perhaps the ebuild broken: pdns consists essentially only of this binary (at least in version 1.2.9a).
Comment 10 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-03-31 04:49:27 UTC
Guys, net-dns/pdns and net-dns/pdnsd are two completely different packages. This bug is about the latter package.
Comment 11 Pacho Ramos gentoo-dev 2014-04-05 08:23:49 UTC
+*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)
+