Stubby from net-dns/getdns-1.6.0_beta1-r2 doesn't start correctly when launched by /etc/init.d/stubby init script because it is not able to create its pid file. This init scripts starts stubby as "stubby" user, but this user has no write permissions on "/run" directory to create the pid file. The init script tries to work it around by pre-creating an empty pid file with the correct permissions and ownership, however this doesn't matter since start-stop-daemon will remove the pid file anyway before staring its child, see here: https://github.com/OpenRC/openrc/blame/master/src/rc/start-stop-daemon.c#L759 So by the time the stubby daemon starts the pid file is no longer there and it has no permissions to create it again. That's why it fails to start. A possible fix is to make stubby use the "/run/stubby/" directory for its pid file, as -r1 version of the init script did. A patch doing this made against the init script and getdns ebuild is attached. In addition to the above issue, it is not necessary to remove the pid file on stop action in this init script - start-stop-daemon will do it for us.
Created attachment 630886 [details, diff] a possible fix
The package was recently bumped, yet this bug wasn't fixed even though I have included a patch here...
Hate to post a +1 comment, but I'm facing the same issue. The issue is successfully resolved by attached getdns-stubby.patch.
Hello, If my pull request for maintaining this package again is merged, I’ll fix the ebuild and initd with your patch
(In reply to Quentin Retornaz from comment #4) > Hello, > If my pull request for maintaining this package again is merged, I’ll fix > the ebuild and initd with your patch I don't think this is a helpful thing to comment: https://bugs.gentoo.org/719868#c2.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f07fbf4f25958dbe59deacaca26e0ecfa426d979 commit f07fbf4f25958dbe59deacaca26e0ecfa426d979 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-07-31 02:02:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-07-31 02:03:01 +0000 net-dns/getdns: fix stubby init script Closes: https://bugs.gentoo.org/716492 Thanks-to: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Sam James <sam@gentoo.org> net-dns/getdns/files/stubby.initd-r2 | 9 ++------- net-dns/getdns/{getdns-1.7.0.ebuild => getdns-1.7.0-r1.ebuild} | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-)