Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716492 - net-dns/getdns-1.6.0_beta1-r2: init script doesn't start stubby correctly
Summary: net-dns/getdns-1.6.0_beta1-r2: init script doesn't start stubby correctly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-04-06 19:50 UTC by Maciej S. Szmigiero
Modified: 2021-07-31 02:04 UTC (History)
5 users (show)

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


Attachments
a possible fix (getdns-stubby.patch,1.13 KB, patch)
2020-04-06 19:51 UTC, Maciej S. Szmigiero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2020-04-06 19:50:06 UTC
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.
Comment 1 Maciej S. Szmigiero 2020-04-06 19:51:30 UTC
Created attachment 630886 [details, diff]
a possible fix
Comment 2 Maciej S. Szmigiero 2021-06-14 00:03:37 UTC
The package was recently bumped, yet this bug wasn't fixed even though I have included a patch here...
Comment 3 Alix 2021-07-17 07:03:28 UTC
Hate to post a +1 comment, but I'm facing the same issue. The issue is successfully resolved by attached getdns-stubby.patch.
Comment 4 Quentin Retornaz 2021-07-23 21:43:32 UTC
Hello,
If my pull request for maintaining this package again is merged, I’ll fix the ebuild and initd with your patch
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-31 01:55:01 UTC
(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.
Comment 6 Larry the Git Cow gentoo-dev 2021-07-31 02:04:50 UTC
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(-)