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.
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.
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.
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.
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.
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
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.
Indeed, that was quite quick - thanks a bunch!
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.
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.
Pull request at https://github.com/gentoo/gentoo/pull/5773
Pull request was merged, I think we can close.
Thanks!