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
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
Keywords: PATCH
Depends on:
Reported: 2020-04-06 19:50 UTC by Maciej S. Szmigiero
Modified: 2020-04-06 21:05 UTC (History)
1 user (show)

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

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:

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