<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:宋体;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>I do make a mistake because I just print os.getuid() show the user root; but os.geteuid() show the current user is still vdsm;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Anyway , I still don’t know how to debug vdsm, I cann’t log in to centos with user VDSM, because I don’t know the passwd of user vdsm and if I changed the password, the service vdsmd will cann’t start.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>You told me “</span><span lang=EN-US>should follow the devel setup wiki</span><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>” , what’s the true link of vdsm devel setup wiki ?  I can’t get useful information in ovirt.org or google.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt'>发件人<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:10.0pt'> Michal Skrivanek [mailto:mskrivan@redhat.com] <br></span><b><span style='font-size:10.0pt'>发送时间<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:10.0pt'> 2016</span><span style='font-size:10.0pt'>年<span lang=EN-US>7</span>月<span lang=EN-US>26</span>日<span lang=EN-US> 5:00<br></span><b>收件人<span lang=EN-US>:</span></b><span lang=EN-US> lifuqiong<br></span><b>抄送<span lang=EN-US>:</span></b><span lang=EN-US> users; devel<br></span><b>主题<span lang=EN-US>:</span></b><span lang=EN-US> Re: [ovirt-devel] Debug vdsm 4.0.0 report error: libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied<o:p></o:p></span></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US><br>On 25 Jul 2016, at 21:50, Sandro Bonazzola &lt;<a href="mailto:sbonazzo@redhat.com">sbonazzo@redhat.com</a>&gt; wrote:<o:p></o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p><span lang=EN-US>Adding some people from virt team.<o:p></o:p></span></p><p><span lang=EN-US>Il 23/Lug/2016 11:44, &quot;lifuqiong&quot; &lt;<a href="mailto:lifuqiong@cncloudsec.com">lifuqiong@cncloudsec.com</a>&gt; ha scritto:<br>&gt;<br>&gt; I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root, &nbsp;and get an error as follows:<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; Problem:<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; Traceback (most recent call last):<br>&gt;<br>&gt; &nbsp; File &quot;/usr/share/vdsm/vdsm&quot;, line 149, in run<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; serve_clients(log)<br>&gt;<br>&gt; &nbsp; File &quot;/usr/share/vdsm/vdsm&quot;, line 104, in serve_clients<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; cif = clientIF.getInstance(irs, log, scheduler)<br>&gt;<br>&gt; &nbsp; File &quot;/usr/share/vdsm/clientIF.py&quot;, line 204, in getInstance<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; cls._instance = clientIF(irs, log, scheduler)<br>&gt;<br>&gt; &nbsp; File &quot;/usr/share/vdsm/clientIF.py&quot;, line 106, in __init__<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; secret.clear()<br>&gt;<br>&gt; &nbsp; File &quot;/usr/lib/python2.7/site-packages/vdsm/virt/secret.py&quot;, line 92, in clear<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; con = libvirtconnection.get()<br>&gt;<br>&gt; &nbsp; File &quot;/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py&quot;, line 163, in get<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; password)<br>&gt;<br>&gt; &nbsp; File &quot;/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py&quot;, line 99, in open_connection<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; return utils.retry(libvirtOpen, timeout=10, sleep=0.2)<br>&gt;<br>&gt; &nbsp; File &quot;/usr/lib/python2.7/site-packages/vdsm/utils.py&quot;, line 546, in retry<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; return func()<br>&gt;<br>&gt; &nbsp; File &quot;/usr/lib64/python2.7/site-packages/libvirt.py&quot;, line 105, in openAuth<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>&gt;<br>&gt; libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; Investitate:<br>&gt;<br>&gt; According to the traceback above, the code in libvirt.py as below, and &nbsp;os.geteuid() get ‘0’ which shows the current user is root;<o:p></o:p></span></p></div></blockquote><div><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p></div><p class=MsoNormal><span lang=EN-US>vdsm is not supposed to be run under root user. For debugging you should follow the devel setup wiki and not change a regular host.&nbsp;<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US>Depends what you modified, it's impossible to say from what you described....but a general advice is you simply don't do that:)<br><br><o:p></o:p></span></p><div><p><span lang=EN-US>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; def openAuth(uri, auth, flags=0):<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #print os.geteuid()<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br>&gt;<br>&gt; &nbsp;&nbsp;&nbsp; if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>&gt;<br>&gt; return virConnect(_obj=ret)<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; [root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock<br>&gt;<br>&gt; srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; According that, root should not get an Permission denied error ? But why?<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; And I setenforce=0 , and still show Perssion denied error.<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; What’s the reason? And how to solve it?<br>&gt;<br>&gt; &nbsp;<br>&gt;<br>&gt; Thank you.<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Devel mailing list<br>&gt; <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>&gt; <a href="http://lists.ovirt.org/mailman/listinfo/devel">http://lists.ovirt.org/mailman/listinfo/devel</a><o:p></o:p></span></p></div></div></div></body></html>