Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 624096 - app-emulation/lxd: Allow disabling net-dns/dnsmasq dependency
Summary: app-emulation/lxd: Allow disabling net-dns/dnsmasq dependency
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Erik Mackdanz
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 11:14 UTC by Nelo-T. Wallus (ntnn)
Modified: 2017-09-30 07:32 UTC (History)
3 users (show)

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


Attachments
add use flag dnsmasq (0001-app-emulation-lxd-Add-use-flag-dnsmasq-allows-not-de.patch,1.53 KB, patch)
2017-07-07 11:14 UTC, Nelo-T. Wallus (ntnn)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nelo-T. Wallus (ntnn) 2017-07-07 11:14:39 UTC
Created attachment 481502 [details, diff]
add use flag dnsmasq

app-emulation/lxd currently rdepends on net-dns/dnsmasq and cannot be disabled.

dnsmasq is needed for lxd-managed networks, where dnsmasq is started by lxd, rather than by the service daemon. An lxd-managed network is only set up during initialization of the lxd server if the user answeres accordingly and if a user defines an lxd-managed network.

Hence dnsmasq isn't a hard runtime dependency and can be safely disabled in setups which use other tools to provide dns/dhcp. 

While it is possible to pretend that it is installed via package.provided, I'd rather be able to disable the dependency.

I'm attaching a patch I use in my overlay, but any way would work for me, as long as I can disable the dependency on dnsmasq.
Comment 1 Virgil Dupras (RETIRED) gentoo-dev 2017-08-15 00:39:39 UTC
Thanks for this patch and sorry for the delay in acknowledging it. The current maintainer apparently became inactive and I've just became the proxy maintainer for this package.

Once I'm finished refreshing up the package, I'll look into integrating your patch.
Comment 2 Virgil Dupras (RETIRED) gentoo-dev 2017-08-17 00:47:34 UTC
I've tried to uninstall dnsmasq on my system to see how LXD 2.16 would like it, and on my system, it refuses to launch with this message:

error: exec: "dnsmasq": executable file not found in $PATH

At first, I thought it was because my containers were already using managed bridges, so I tossed my /var/lib/lxd away, to no avail: LXD refuses to start without dnsmasq.

I'd tend to conclude that dnsmasq has become a hard dependency.
Comment 3 Nelo-T. Wallus (ntnn) 2017-08-18 16:13:24 UTC
Please verify that you have no managed networks with `lxc network list`.

I don't imagine that graber would make dnsmasq a hard dependency as many users, particularly organizations, are using lxd without it.
Comment 4 Virgil Dupras (RETIRED) gentoo-dev 2017-08-18 16:27:48 UTC
Well, have you tried it yourself? According to https://github.com/lxc/lxd/blob/2367206747d1105b9dbd90d2c3f02ffca40d28a7/lxd/main_daemon.go#L36 , dnsmasq is a hard dependency. There's isn't any condition related to the presence or not of a managed network in that check.
Comment 5 Nelo-T. Wallus (ntnn) 2017-08-18 16:34:48 UTC
Yes, I just tried it. It seems it doesn't work anymore after 2.8 - which is the version I'm running on my servers.

I've opened an issue for that in the project:
https://github.com/lxc/lxd/issues/3678
Comment 6 Virgil Dupras (RETIRED) gentoo-dev 2017-08-19 14:38:36 UTC
Whoa, response time was good! So I'm guessing that as soon as v2.17 is out, we can add this flag you're suggesting.
Comment 7 Nelo-T. Wallus (ntnn) 2017-08-20 17:54:59 UTC
Indeed, that was quite quick - thanks a bunch!
Comment 8 Virgil Dupras (RETIRED) gentoo-dev 2017-09-05 12:24:31 UTC
According to USE flag policies ( https://devmanual.gentoo.org/general-concepts/use-flags/index.html ), we shouldn't use USE flags for run-time dependencies.

Instead, we should remove the dependency and add it to https://github.com/gentoo/gentoo/blob/master/app-emulation/lxd/lxd-2.16.ebuild#L194

But then again, LXD's functionalities are severely limited without dnsmasq and in the vast majority of cases, you'll want to have it. Removing the dependency could lead to users having to needlessly mess around with their system to have a functional setup. Maybe a gentoo dev could give us some advice here.
Comment 9 Nelo-T. Wallus (ntnn) 2017-09-06 08:01:34 UTC
I've discussed the proposed change with my mentor Polynomial-C before opening the issue. Given that LXD is pretty much unusable in a vanilla setup with dnsmasq its okay to have it as a dependency. Hence the discussion in my opening comment.
Comment 10 Virgil Dupras (RETIRED) gentoo-dev 2017-09-23 13:34:57 UTC
Pull request at https://github.com/gentoo/gentoo/pull/5773
Comment 11 Virgil Dupras (RETIRED) gentoo-dev 2017-09-24 11:51:23 UTC
Pull request was merged, I think we can close.
Comment 12 Nelo-T. Wallus (ntnn) 2017-09-30 07:32:13 UTC
Thanks!