RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1820437 - Libvirtd service is not restarted on upgrade if socket activation is disabled
Summary: Libvirtd service is not restarted on upgrade if socket activation is disabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks: 1897025
TreeView+ depends on / blocked
 
Reported: 2020-04-03 05:27 UTC by mxie@redhat.com
Modified: 2023-05-09 08:06 UTC (History)
18 users (show)

Fixed In Version: libvirt-9.0.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:26:10 UTC
Type: Bug
Target Upstream Version: 9.0.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker LIBVIRTAT-14185 0 None None None 2023-04-20 02:28:03 UTC
Red Hat Product Errata RHBA-2023:2171 0 None None None 2023-05-09 07:26:53 UTC

Description mxie@redhat.com 2020-04-03 05:27:43 UTC
Description of problem:
Libvirtd service with systemd socket activation disabled can't restart automatically after updating/downgrading libvirt packages


Version-Release number of selected component (if applicable):
libvirt-6.0.0-16.module+el8.2.0+6139+d66dece5.x86_64
qemu-kvm-4.2.0-17.module+el8.2.0+6141+0f540f16.x86_64
virt-v2v-1.40.2-22.module+el8.2.0+6029+618ef2ec.x86_64


How reproducible:
100%


Steps to Reproduce:
1.Modify /etc/sysconfig/libvirtd to disable systemd socket activation

# If systemd socket activation is disabled, then the following
# can be used to listen on TCP/TLS sockets
LIBVIRTD_ARGS="--listen"


2.Check current version of libvirt packages and status of libvirtd service, the active time of libvirtd service is 2020-04-03 10:39:50

# rpm -q libvirt 
libvirt-6.0.0-12.module+el8.2.0+6034+e58cb6e4.x86_64

# service libvirtd status
Redirecting to /bin/systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-04-03 10:39:50 CST; 2min 26s ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 189988 (libvirtd)
    Tasks: 17 (limit: 32768)
   Memory: 26.8M
   CGroup: /system.slice/libvirtd.service
           └─189988 /usr/sbin/libvirtd --listen


3.Update libvirt packages to 6.0.0-16, check status of libvirtd service after updating, found active time of libvirtd service is still 2020-04-03 10:39:50 which means libvirtd service isn't restarted automatically

#yum update libvirt -y

#rpm -q libvirt
libvirt-6.0.0-16.module+el8.2.0+6139+d66dece5.x86_64

# service libvirtd status
Redirecting to /bin/systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-04-03 10:39:50 CST; 5min ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 189988 (libvirtd)
    Tasks: 17 (limit: 32768)
   Memory: 26.9M
   CGroup: /system.slice/libvirtd.service
           └─189988 /usr/sbin/libvirtd --listen


Actual results:
As above description


Expected results:
Libvirtd service with systemd socket activation disabled can't restart automatically after updating/downgrading libvirt packages


Additional info:
Libvirtd service with systemd socket activation enabled can restart automatically after updating/downgrading libvirt packages

1.Modify /etc/sysconfig/libvirtd to enable systemd socket activation
# cat /etc/sysconfig/libvirtd
...
#LIBVIRTD_ARGS="--timeout 120"
....

2.Check current libvirt package version and libvirtd service status
# rpm -q libvirt
libvirt-6.0.0-12.module+el8.2.0+6034+e58cb6e4.x86_64

# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-04-03 13:18:45 CST; 1min 27s ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 203497 (libvirtd)
    Tasks: 17 (limit: 32768)
   Memory: 26.3M
   CGroup: /system.slice/libvirtd.service
           └─203497 /usr/sbin/libvirtd

3. Update libvirt and check libvirtd service status, the active time of libvirtd service is changed

# yum update libvirt -y

# rpm -q libvirt
libvirt-6.0.0-16.module+el8.2.0+6139+d66dece5.x86_64

# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-04-03 13:22:22 CST; 29s ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 204219 (libvirtd)
    Tasks: 17 (limit: 32768)
   Memory: 25.4M
   CGroup: /system.slice/libvirtd.service
           └─204219 /usr/sbin/libvirtd

Comment 1 Jaroslav Suchanek 2020-05-06 12:57:58 UTC
It seems to be introduced by commit 66d04312d03c24c62bcf3b1dc2706f8775d4e2d3.

If you intentionally edit the /etc/sysconfig/libvirtd you basically disable socket activation with next upgrade and keep the traditional startup mode without restarting the daemon. Dan is this intentional? If so, please close this bug. Thanks.

Comment 2 Daniel Berrangé 2020-05-06 13:05:48 UTC
This is a valid bug - we must *ALWAYS* ensure libvirtd is restarted if it was previously running. This is true regardless of socket activation state.

Comment 6 John Ferlan 2021-09-09 15:56:57 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 7 RHEL Program Management 2022-04-03 07:27:19 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 8 yafu 2022-04-12 06:49:30 UTC
Hi John,

I reopened the bug. Could you help to confirm whether this bug should be fixed please? 
Thanks.

Comment 10 John Ferlan 2022-04-12 16:03:02 UTC
Passing the needinfo to Jarda... Seems based on Daniel's response that this needs to be resolved - whether it has or hasn't already been resolved is something I'm not sure.

Comment 11 Jaroslav Suchanek 2022-06-07 10:41:37 UTC
Can you please re-test it with current RHEL-9 and add reproducer description to the comment? Thanks.

Comment 12 yafu 2022-06-08 03:05:26 UTC
(In reply to Jaroslav Suchanek from comment #11)
> Can you please re-test it with current RHEL-9 and add reproducer description
> to the comment? Thanks.

Hi Jarda,

In my understanding, the bug only reproduces when upgrading from rhel8 or lower versions 
and can not reproduce when upgrading from rhel9, because modular daemons starting by systemd 
always exist with the socket activation. 
According to https://bugzilla.redhat.com/show_bug.cgi?id=1822890#c2, virtproxyd process 
does not support "--listen" option.

Thanks,
Yan Fu

Comment 14 yalzhang@redhat.com 2022-10-19 01:34:17 UTC
Hi Jarda, 

Could you please help to evaluate if this bug need to be fixed? If yes, I will extend the stale date or it will be auto closed. Thank you!

Comment 15 RHEL Program Management 2022-10-19 01:34:26 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 16 Jaroslav Suchanek 2022-11-02 17:09:33 UTC
Yes, this should be fixed.

Comment 18 Martin Kletzander 2023-01-10 14:28:43 UTC
Fix proposed upstream:

https://www.mail-archive.com/libvir-list@redhat.com/msg234877.html

Comment 19 Martin Kletzander 2023-01-10 14:52:32 UTC
Fixed upstream with v9.0.0-rc1-3-g8f93d546d198:
commit 8f93d546d198c7dc47068dbc0f233aad28b0e33a
Author: Martin Kletzander <mkletzan>
Date:   Tue Jan 10 12:21:56 2023 +0100

    spec: Restart libvirtd on upgrade without socket activation

Comment 20 yafu 2023-01-29 08:44:48 UTC
Reproduced with libvirt-8.10.0-1.el9.x86_64.

Verified with libvirt-9.0.0-2.el9.x86_64.
Test steps:
1.Disable virtqemud and enable libvirtd:
#systemclt disable virtqemud
#systemctl enable libvirtd

2.Create sysconfig file to disable socket activation:
#cat /etc/sysconfig/libvirtd
LIBVIRTD_ARGS="--listen"

3.Revert to the traditional mode:
# systemctl mask libvirtd.socket libvirtd-ro.socket \
             libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket

4.Disable auth_tls in libvirtd.conf:
#vim /etc/libvirt/libvirtd.conf
listen_tls = 1
auth_tls = "none"

5.Restart libvirtd:
#systemctl restart libvirtd

6.Check libvirtd's mode:
# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset:>
     Active: active (running) since Sun 2023-01-29 03:02:53 EST; 5s ago
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 829411 (libvirtd)
      Tasks: 19 (limit: 32768)
     Memory: 18.8M
        CPU: 552ms
     CGroup: /system.slice/libvirtd.service
             └─829411 ***/usr/sbin/libvirtd --listen***


7.Upgrade libvirt pkgs:
#yum -y upgrade libvirt
...
Upgraded:
  libvirt-9.0.0-2.el9.x86_64                                                                                    
  libvirt-client-9.0.0-2.el9.x86_64                                                                             
  libvirt-daemon-9.0.0-2.el9.x86_64                                                                             
  libvirt-daemon-config-network-9.0.0-2.el9.x86_64
...

8.Confirm libvirtd was restarting in step7:
# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: ***active (running) since Sun 2023-01-29 03:12:34 EST; 6s ago***
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 830260 (libvirtd)
      Tasks: 19 (limit: 32768)
     Memory: 22.9M
        CPU: 556ms
     CGroup: /system.slice/libvirtd.service
             └─830260 /usr/sbin/libvirtd --listen

Comment 24 yafu 2023-02-02 09:54:47 UTC
Verified with libvirt-9.0.0-3.el9.x86_64.

Comment 26 errata-xmlrpc 2023-05-09 07:26:10 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 (libvirt 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/RHBA-2023:2171


Note You need to log in before you can comment on or make changes to this bug.