You are not logged in.

#1 2019-04-05 18:04:31

norg
Member
Registered: 2012-01-13
Posts: 24

force libvirt to run dnsmasq as a specific user

Hi,

I have the following issue. I want to run dnsmasq as a specific user so it can read a specific directory for tftp-root.
The problem is that dnsmasq runs as the user nobody. While I can manually fix it by either passing -u flag or set the user in `/var/lib/libvirt/dnsmasq/default.conf` but this file is overwritten everytime I use `net-start default`.

Ubuntu solved this issue by introducing a dedicated libvirt-dnsmasq user and adds this to the config file created by net-start.

Is there a proper solution for that use case besides changing the tftp-root folder to one that is readable by nobody?

To reproduce it:

virsh net-edit default
add a <tftp root='/home/foo/bar'/> entry
virsh net-start default

And you will end up with:

error: Failed to start network default
error: internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/u
dnsmasq: TFTP directory /home/foo/bar inaccessible: Permission denied

If the dnsmasq child process would use -u foo it would work, same with user=foo entry in the default.conf.

Thanks

Last edited by norg (2019-04-08 07:55:27)

Offline

Board footer

Powered by FluxBB