Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Virsh is stucked when running in background, if affects to Virtual Domain cluster resource, it is based on virsh.
Version-Release number of selected component (if applicable):
libvirt-client-8.0.0-5.4.module+el8.6.0+16370+bb85faee.x86_64
# virsh version
Compiled against library: libvirt 8.0.0
Using library: libvirt 8.0.0
Using API: QEMU 8.0.0
Running hypervisor: QEMU 6.2.0
How reproducible:
tee ~/virsh_test.sh <<EOF
#!/bin/bash
virsh list --all
EOF
# chmod u+x ~/virsh_test.sh
# ~/virsh_test.sh
Id Name State
--------------------
# ~/virsh_test.sh 2>stderr &
# ps f
PID TTY STAT TIME COMMAND
101995 pts/0 Ss 0:00 -bash
144669 pts/0 T 0:00 \_ -bash
144670 pts/0 Tl 0:00 | \_ /usr/bin/virsh list --all
144672 pts/0 Tl 0:00 | \_ /usr/bin/pkttyagent --process 144670 --notify-fd 4 --fallback
144676 pts/0 R+ 0:00 \_ ps f
1296 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
[1]+ Stopped ~/virsh_test.sh 2> stderr
# fg
~/virsh_test.sh 2> stderr
Id Name State
--------------------
Steps to Reproduce:
1.
2.
3.
Actual results:
Virsh command is stopped.
Expected results:
Virsh not being stucked and is hindering the proper execution of cluster Virtual Domain resources.
Additional info:
The problem is not observed in virsh version 8.1, I don't know what patch or patches resolve the issue, only found this related gitlab thread [1] and this mail discussion [2].
This bugzilla is not marked as Urgent because we found a workaround which consists on the creation of a little script that calls virsh with the setuid command, like this one,
# tee /usr/local/bin/virsh <<EOF
#!/bin/bash
setsid --wait /usr/bin/virsh "\$@"
EOF
sudo chmod +x /usr/local/bin/virsh
[1] https://gitlab.com/libvirt/libvirt/-/issues/366
[2] https://listman.redhat.com/archives/libvir-list/2021-December/226188.html
Comment 3Martin Kletzander
2022-10-25 11:55:54 UTC
The fix was merged upstream to polkit and it looks like it fixes the issue:
https://gitlab.freedesktop.org/polkit/polkit/-/commit/07593c1055ddbdda85465e09da1f44b1b4f0fc3d
It is caused originally by a combination of two commits, one in polkit fixing Bug 1693781 and one in libvirt fixing Bug 1945501.
To reproduce this it is enough to run pkttyagent in the background and kill it. It can even be used to put in a password and then backgrounded and killed:
$ pkttyagent &
$ kill %1
$
[1]+ Terminated pkttyagent
$
It should not get stopped and it should not disable echo for the terminal (both of which could happen before this patch due to bash changing the tty attributes). On top of that any of the aforementioned BZs should not be broken by this change.
I'm reassigning this to polkit since there is nothing to do in libvirt.
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 (polkit 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:3051
Description of problem: Virsh is stucked when running in background, if affects to Virtual Domain cluster resource, it is based on virsh. Version-Release number of selected component (if applicable): libvirt-client-8.0.0-5.4.module+el8.6.0+16370+bb85faee.x86_64 # virsh version Compiled against library: libvirt 8.0.0 Using library: libvirt 8.0.0 Using API: QEMU 8.0.0 Running hypervisor: QEMU 6.2.0 How reproducible: tee ~/virsh_test.sh <<EOF #!/bin/bash virsh list --all EOF # chmod u+x ~/virsh_test.sh # ~/virsh_test.sh Id Name State -------------------- # ~/virsh_test.sh 2>stderr & # ps f PID TTY STAT TIME COMMAND 101995 pts/0 Ss 0:00 -bash 144669 pts/0 T 0:00 \_ -bash 144670 pts/0 Tl 0:00 | \_ /usr/bin/virsh list --all 144672 pts/0 Tl 0:00 | \_ /usr/bin/pkttyagent --process 144670 --notify-fd 4 --fallback 144676 pts/0 R+ 0:00 \_ ps f 1296 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux [1]+ Stopped ~/virsh_test.sh 2> stderr # fg ~/virsh_test.sh 2> stderr Id Name State -------------------- Steps to Reproduce: 1. 2. 3. Actual results: Virsh command is stopped. Expected results: Virsh not being stucked and is hindering the proper execution of cluster Virtual Domain resources. Additional info: The problem is not observed in virsh version 8.1, I don't know what patch or patches resolve the issue, only found this related gitlab thread [1] and this mail discussion [2]. This bugzilla is not marked as Urgent because we found a workaround which consists on the creation of a little script that calls virsh with the setuid command, like this one, # tee /usr/local/bin/virsh <<EOF #!/bin/bash setsid --wait /usr/bin/virsh "\$@" EOF sudo chmod +x /usr/local/bin/virsh [1] https://gitlab.com/libvirt/libvirt/-/issues/366 [2] https://listman.redhat.com/archives/libvir-list/2021-December/226188.html