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.
Created attachment 370870 [details, diff] Patch for /etc/init.d/pdnsd
Created attachment 370872 [details] pdnsd.service unit
(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
(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?
> 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).
I also really prefer to use tmpfiles.d :/
(In reply to Pacho Ramos from comment #6) > I also really prefer to use tmpfiles.d :/ Then doit... -.-
/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
(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).
Guys, net-dns/pdns and net-dns/pdnsd are two completely different packages. This bug is about the latter package.
+*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) +