dnsmasq cannot read /var/lib/libvirt/dnsmasq/default.hostsfile: Permission denied

Asked by David Tio

I am currently using Ubuntu 24.04, upgraded from Ubuntu 22.04

I notice that my DHCP IP assignment was not working recently and when I check the status of libvirtd.service I see the message:
Jun 01 07:07:50 dttp dnsmasq[2921]: failed to load names from /var/lib/libvirt/dnsmasq/default.addnhosts: Permission denied
Jun 01 07:07:50 dttp dnsmasq[2921]: cannot read /var/lib/libvirt/dnsmasq/default.hostsfile: Permission denied

Both files seems to be recreated by libvirtd upton starting.

The permission of the files are:
-rw-r--r-- 1 root root 0 Jun 1 07:07 default.hostsfile
-rw-r--r-- 1 root root 0 Jun 1 07:07 default.addnhosts

The file should still be world readable. I can't figure out what seems to be the issue.

Anyone encounter this issue ? Any advice ?

Question information

Language:
English Edit question
Status:
Needs information
For:
Ubuntu libvirt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1
Revision history for this message
David Tio (dtio) said :
#2

Hi actionparnsnip,

I don't even have selinux installed.
root@hostname:~# getenforce
Command 'getenforce' not found, but can be installed with:
apt install selinux-utils

root@hostname:~# ls -ld /var/lib/libvirt/dnsmasq/default*
-rw-r--r-- 1 root root 0 Jun 1 07:07 /var/lib/libvirt/dnsmasq/default.addnhosts
-rw-rw---- 1 root root 619 May 31 22:26 /var/lib/libvirt/dnsmasq/default.conf
-rw-r--r-- 1 root root 0 Jun 1 07:07 /var/lib/libvirt/dnsmasq/default.hostsfile

It was able to read default.conf, only default.addnhosts and default.hostsfile encounter permission denied.

I have tried to manually change the permission of the two files to 660 but it always revert back to 644.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Are there any bugs reported? Could be a mount issue. What is the output of:

mount

Revision history for this message
David Tio (dtio) said :
#4

I am not aware of any bugs reported on this issue.

I assume we are looking at /var/lib/libvirt mount point ?

/dev/nvme1n1 on /var/lib/libvirt type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)

I don't see any mount issues reported by mount command too

Revision history for this message
David Tio (dtio) said :
#5

I am not aware of any bugs reported on this issue.

I assume we are looking at /var/lib/libvirt mount point ?

/dev/nvme1n1 on /var/lib/libvirt type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)

I don't see any mount issues reported by mount command too

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

If you fsck the file system (will need to be offline so may need to be done in Live Ubuntu USB boot) is it complete and consistent?

Revision history for this message
David Tio (dtio) said :
#7

Yes, the filesystem is complete and consistent.

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

Does "lsattr /var/lib/libvirt/dnsmasq/default*" list anything?
Is there anything in the system logs when the access attempt fails (e.g. a message from apparmor)?

Can you help with this problem?

Provide an answer of your own, or ask David Tio for more information if necessary.

To post a message you must log in.