<p dir="ltr">Adding some people from virt team.</p>
<p dir="ltr">Il 23/Lug/2016 11:44, "lifuqiong" <<a href="mailto:lifuqiong@cncloudsec.com">lifuqiong@cncloudsec.com</a>> ha scritto:<br>
><br>
> I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root, and get an error as follows:<br>
><br>
> <br>
><br>
> Problem:<br>
><br>
> <br>
><br>
> Traceback (most recent call last):<br>
><br>
> File "/usr/share/vdsm/vdsm", line 149, in run<br>
><br>
> serve_clients(log)<br>
><br>
> File "/usr/share/vdsm/vdsm", line 104, in serve_clients<br>
><br>
> cif = clientIF.getInstance(irs, log, scheduler)<br>
><br>
> File "/usr/share/vdsm/clientIF.py", line 204, in getInstance<br>
><br>
> cls._instance = clientIF(irs, log, scheduler)<br>
><br>
> File "/usr/share/vdsm/clientIF.py", line 106, in __init__<br>
><br>
> secret.clear()<br>
><br>
> File "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line 92, in clear<br>
><br>
> con = libvirtconnection.get()<br>
><br>
> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 163, in get<br>
><br>
> password)<br>
><br>
> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 99, in open_connection<br>
><br>
> return utils.retry(libvirtOpen, timeout=10, sleep=0.2)<br>
><br>
> File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in retry<br>
><br>
> return func()<br>
><br>
> File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in openAuth<br>
><br>
> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>
><br>
> libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied<br>
><br>
> <br>
><br>
> Investitate:<br>
><br>
> According to the traceback above, the code in libvirt.py as below, and os.geteuid() get ‘0’ which shows the current user is root;<br>
><br>
> <br>
><br>
> def openAuth(uri, auth, flags=0):<br>
><br>
> #print os.geteuid()<br>
><br>
> ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br>
><br>
> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>
><br>
> return virConnect(_obj=ret)<br>
><br>
> <br>
><br>
> [root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock<br>
><br>
> srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock<br>
><br>
> <br>
><br>
> According that, root should not get an Permission denied error ? But why?<br>
><br>
> <br>
><br>
> And I setenforce=0 , and still show Perssion denied error.<br>
><br>
> <br>
><br>
> What’s the reason? And how to solve it?<br>
><br>
> <br>
><br>
> Thank you.<br>
><br>
><br>
> _______________________________________________<br>
> Devel mailing list<br>
> <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/devel">http://lists.ovirt.org/mailman/listinfo/devel</a><br></p>