Bug 1810863

Summary: virtlogd does not start while staring virtqemud service
Product: Red Hat Enterprise Linux 8 Reporter: yafu <yafu>
Component: libvirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED ERRATA QA Contact: yafu <yafu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: berrange, chhu, jdenemar, jsuchane, lmen, virt-maint, xuzhang, yalzhang, yanqzhan
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: 8.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.8.0-1.module+el8.6.0+12978+7d7a0321 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2001997 (view as bug list) Environment:
Last Closed: 2022-05-10 13:18:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 7.7.0
Embargoed:
Bug Depends On:    
Bug Blocks: 2001997    

Description yafu 2020-03-06 04:08:15 UTC
Description of problem:
virtlogd does not start while staring virtqemud service.

Version-Release number of selected component (if applicable):
libvirt-6.0.0-7.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Disable libvirtd and enable virtqemud service:
  #systemctl stop libvirtd.service
  #systemctl disable libvirtd{,-ro,-admin,-tcp,-tls}.socket
  #systemctl unmask virtqemud.service
  #systemctl unmask virtqemud{,-ro,-admin}.socket
  #systemctl enable virtqemud.service
  #systemctl enable virtqemud{,-ro,-admin}.socket

2.Reboot host

3.Start a guest:
#virsh -c qemu:///system start vm
error: Failed to start domain vm
error: can't connect to virtlogd: Failed to connect socket to '/run/libvirt/virtlogd-sock': No such file or directory

4.Check virtlogd status:
# systemctl status virtlogd
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:virtlogd(8)
           https://libvirt.org


Actual results:
virtlogd should start while starting vritqemud service

Expected results:
vIrtlogd does not start while staring virtqemud service.

Additional info:

Comment 1 Daniel Berrangé 2020-03-06 10:13:31 UTC
The /run/libvirt/virtlogd-sock  should be provided by the "virtlogd.socket" system unit.

That should be enabled by default on all RHEL systems.  Can you check whether that socket path actually exists on disk current.

If it does exist, then possibly something like SELinux denies access.

There was a SELinux policy update for the daemons required so check that is installed too https://bugzilla.redhat.com/show_bug.cgi?id=1745076

Comment 2 yafu 2020-03-12 13:31:11 UTC
(In reply to Daniel Berrangé from comment #1)
> The /run/libvirt/virtlogd-sock  should be provided by the "virtlogd.socket"
> system unit.
> 
> That should be enabled by default on all RHEL systems.  Can you check
> whether that socket path actually exists on disk current.
> 
> If it does exist, then possibly something like SELinux denies access.
> 
> There was a SELinux policy update for the daemons required so check that is
> installed too https://bugzilla.redhat.com/show_bug.cgi?id=1745076

I reproduce the issue with the following steps and did not find /run/libvirt/virtlogd-sock.
#systemctl stop libvirtd.service
#systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
#systemctl disable libvirtd.service        
#systemctl disable libvirtd{,-ro,-admin,-tcp,-tls}.socket
#for drv in qemu interface network nodedev nwfilter secret storage proxy; do systemctl unmask virt${drv}d.service; systemctl unmask virt${drv}d{,-ro,-admin}.socket; systemctl enable virt${drv}d.service; systemctl enable virt${drv}d{,-ro,-admin}.socket; done
#reboot

After host boot, check the socket file under /run/libvirt/
#ll /run/libvirt/ | grep -i virtlog
no output

Comment 5 RHEL Program Management 2021-09-06 07:27:07 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 7 Daniel Berrangé 2021-09-06 08:46:34 UTC
Fixed upstream in 

commit 88c5b9f827779ae6fe5a6f08100a4b6184492a1c
Author: Daniel P. Berrangé <berrange>
Date:   Tue Aug 31 10:59:39 2021 +0100

    qemu, xen: add missing deps on virtlockd/virtlogd sockets
    
    The QEMU driver uses both virtlogd and virtlockd, while the Xen driver
    uses virtlockd. The libvirtd.service unit contains deps on the socket
    units for these services, but these deps were missed in the modular
    daemons. As a result the virtlockd/virtlogd sockets are not started
    when the virtqemud/virtxend daemons are started.
    
    Reviewed-by: Jiri Denemark <jdenemar>
    Signed-off-by: Daniel P. Berrangé <berrange>

Comment 8 John Ferlan 2021-09-09 18:36:02 UTC
Bulk update: Move RHEL-AV bugs to RHEL8 with existing RHEL9 clone.

Comment 11 yafu 2021-10-26 02:36:23 UTC
Verified with libvirt-daemon-7.8.0-1.module+el8.6.0+12978+7d7a0321.x86_64.

Test steps:
1.Enable modular daemon and reboot os:
#systemctl stop libvirtd.service
#systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
#systemctl disable libvirtd.service        
#systemctl disable libvirtd{,-ro,-admin,-tcp,-tls}.socket
#for drv in qemu interface network nodedev nwfilter secret storage proxy; do systemctl unmask virt${drv}d.service; systemctl unmask virt${drv}d{,-ro,-admin}.socket; systemctl enable virt${drv}d.service; systemctl enable virt${drv}d{,-ro,-admin}.socket; done
#reboot

2.Check the virtlogd socket file:
# ll /run/libvirt/virtlogd-sock 
srw-------. 1 root root 0 Oct 25 22:17 /run/libvirt/virtlogd-sock

3.Check virtlogd service status:
# systemctl status virtlogd
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: active (running) since Mon 2021-10-25 22:25:38 EDT; 10min ago
...

Comment 13 errata-xmlrpc 2022-05-10 13:18:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:1759