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.

Bug 716612

Summary: Failed to reload iptables rules with root permission when starting libvirtd in the way of executing /usr/sbin/libvirtd
Product: Red Hat Enterprise Linux 6 Reporter: Gunannan Ren <gren>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: dallan, dwalsh, gsun, rwu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: sVirt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-13 02:48:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
libvirtd.log
none
audit.log none

Description Gunannan Ren 2011-06-25 13:44:39 UTC
Description of problem:
Stopped libvirtd service, then executed the /usr/sbin/libvirtd to start the libvirtd as the foreground process. it failed to reload iptables rules. In the libvirtd.log it showed error as the follows.

21:51:55.634: 11972: debug : virCommandRunAsync:1310 : About to run /sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 -p tcp ! --destination 192.168.122.0/24 --jump MASQUERADE --to-ports 1024-65535
21:51:55.634: 11972: debug : virExecWithHook:488 : /sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 -p tcp ! --destination 192.168.122.0/24 --jump MASQUERADE --to-ports 1024-65535
21:51:55.634: 11972: debug : virCommandRunAsync:1326 : Command result 0, with PID 11979
21:51:55.638: 11972: error : virCommandWait:1393 : internal error Child process (/sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 -p tcp ! --destination 192.168.122.0/24 --jump MASQUERADE --to-ports 1024-65535) status unexpected: exit status 1
21:51:55.638: 11972: debug : virCommandRun:1147 : Result status 0, stdout: '' stderr: '21:51:55.635: 11979: info : libvirt version: 0.9.2, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-06-20-09:08:08, hs20-bc2-5.build.redhat.com)
21:51:55.635: 11979: debug : virCommandHook:1244 : Hook is done 0
libvir: error : cannot execute binary /sbin/iptables: Permission denied

I tried to set selinux to "Permissive", then checking out the log again, it showed information without errors.

Version-Release number of selected component (if applicable):

libvirt-0.9.2-1.el6.x86_64.rpm

How reproducible:

always

Steps to Reproduce:
1. service libvirtd stop
2. /usr/sbin/libvirtd
3. checkout the libvirtd log
  
Actual results:

Reloading iptables rules failed with permission denied.

Expected results:

success to reload

Additional info:

Comment 1 Gunannan Ren 2011-06-25 13:46:02 UTC
Created attachment 509895 [details]
libvirtd.log

Comment 2 Gunannan Ren 2011-06-25 13:46:35 UTC
Created attachment 509896 [details]
audit.log

Comment 4 Laine Stump 2011-09-09 16:38:00 UTC
Dan - is this expected behavior (libvirtd run from a shell prompt failing to exec iptables, while libvirtd run with /etc/init.d/libvirtd start succeeds)?

Comment 5 Daniel Walsh 2011-09-12 19:42:30 UTC
If you run libvirtd directly it will not transition to the proper domain (virtd_t) and will stay in unconfined_t,  Thus when libvirt attempts to transition to other domains, it blows up with these errors.  We always recommend confined services be run from the init scripts to mimic what happens in the real world.

http://danwalsh.livejournal.com/20210.html

Comment 6 Laine Stump 2011-09-13 02:48:50 UTC
Based on Dan's explanation, I'm closing this as NOTABUG - this is expected behavior.