<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Jul 2016, at 08:02, lifuqiong <<a href="mailto:lifuqiong@cncloudsec.com" class="">lifuqiong@cncloudsec.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">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 class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">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.</span></div></div></div></blockquote><div><br class=""></div>the vdsm account is intentionally disabled for interactive login</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">You told me “</span><span lang="EN-US" class="">should follow the devel setup wiki</span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">” , what’s the true link of vdsm devel setup wiki ? I can’t get useful information in<span class="Apple-converted-space"> </span><a href="http://ovirt.org/" style="color: purple; text-decoration: underline;" class="">ovirt.org</a><span class="Apple-converted-space"> </span>or google.</span></div></div></div></blockquote><div><br class=""></div><a href="http://www.ovirt.org/develop/developer-guide/vdsm/developers/" class="">http://www.ovirt.org/develop/developer-guide/vdsm/developers/</a> has tips how to build from source and what packages are needed</div><div>Anything specific you’re troubleshooting?</div><div><br class=""></div><div>Thanks,</div><div>michal</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Thank you<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><b class=""><span style="font-size: 10pt;" class="">发件人<span lang="EN-US" class="">:</span></span></b><span lang="EN-US" style="font-size: 10pt;" class=""><span class="Apple-converted-space"> </span>Michal Skrivanek [<a href="mailto:mskrivan@redhat.com" class="">mailto:mskrivan@redhat.com</a>]<span class="Apple-converted-space"> </span><br class=""></span><b class=""><span style="font-size: 10pt;" class="">发送时间<span lang="EN-US" class="">:</span></span></b><span lang="EN-US" style="font-size: 10pt;" class=""><span class="Apple-converted-space"> </span>2016</span><span style="font-size: 10pt;" class="">年<span lang="EN-US" class="">7</span>月<span lang="EN-US" class="">26</span>日<span lang="EN-US" class=""><span class="Apple-converted-space"> </span>5:00<br class=""></span><b class="">收件人<span lang="EN-US" class="">:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>lifuqiong<br class=""></span><b class="">抄送<span lang="EN-US" class="">:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>users; devel<br class=""></span><b class="">主题<span lang="EN-US" class="">:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>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 class=""></o:p></span></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div></div><div class=""><p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 12pt; font-family: 宋体;"><span lang="EN-US" class=""><br class="">On 25 Jul 2016, at 21:50, Sandro Bonazzola <<a href="mailto:sbonazzo@redhat.com" style="color: purple; text-decoration: underline;" class="">sbonazzo@redhat.com</a>> wrote:<o:p class=""></o:p></span></p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class="">Adding some people from virt team.<o:p class=""></o:p></span></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class="">Il 23/Lug/2016 11:44, "lifuqiong" <<a href="mailto:lifuqiong@cncloudsec.com" style="color: purple; text-decoration: underline;" class="">lifuqiong@cncloudsec.com</a>> ha scritto:<br class="">><br class="">> I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root, and get an error as follows:<br class="">><br class="">> <br class="">><br class="">> Problem:<br class="">><br class="">> <br class="">><br class="">> Traceback (most recent call last):<br class="">><br class="">> File "/usr/share/vdsm/vdsm", line 149, in run<br class="">><br class="">> serve_clients(log)<br class="">><br class="">> File "/usr/share/vdsm/vdsm", line 104, in serve_clients<br class="">><br class="">> cif = clientIF.getInstance(irs, log, scheduler)<br class="">><br class="">> File "/usr/share/vdsm/clientIF.py", line 204, in getInstance<br class="">><br class="">> cls._instance = clientIF(irs, log, scheduler)<br class="">><br class="">> File "/usr/share/vdsm/clientIF.py", line 106, in __init__<br class="">><br class="">> secret.clear()<br class="">><br class="">> File "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line 92, in clear<br class="">><br class="">> con = libvirtconnection.get()<br class="">><br class="">> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 163, in get<br class="">><br class="">> password)<br class="">><br class="">> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 99, in open_connection<br class="">><br class="">> return utils.retry(libvirtOpen, timeout=10, sleep=0.2)<br class="">><br class="">> File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in retry<br class="">><br class="">> return func()<br class="">><br class="">> File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in openAuth<br class="">><br class="">> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br class="">><br class="">> libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied<br class="">><br class="">> <br class="">><br class="">> Investitate:<br class="">><br class="">> According to the traceback above, the code in libvirt.py as below, and os.geteuid() get ‘0’ which shows the current user is root;<o:p class=""></o:p></span></p></div></blockquote><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class="">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. <o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class="">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 class=""><br class=""><o:p class=""></o:p></span></div><div class=""><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 宋体;" class=""><span lang="EN-US" class="">><br class="">> <br class="">><br class="">> def openAuth(uri, auth, flags=0):<br class="">><br class="">> #print os.geteuid()<br class="">><br class="">> ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br class="">><br class="">> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br class="">><br class="">> return virConnect(_obj=ret)<br class="">><br class="">> <br class="">><br class="">> [root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock<br class="">><br class="">> srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock<br class="">><br class="">> <br class="">><br class="">> According that, root should not get an Permission denied error ? But why?<br class="">><br class="">> <br class="">><br class="">> And I setenforce=0 , and still show Perssion denied error.<br class="">><br class="">> <br class="">><br class="">> What’s the reason? And how to solve it?<br class="">><br class="">> <br class="">><br class="">> Thank you.<br class="">><br class="">><br class="">> _______________________________________________<br class="">> Devel mailing list<br class="">><span class="Apple-converted-space"> </span><a href="mailto:Devel@ovirt.org" style="color: purple; text-decoration: underline;" class="">Devel@ovirt.org</a><br class="">><span class="Apple-converted-space"> </span><a href="http://lists.ovirt.org/mailman/listinfo/devel" style="color: purple; text-decoration: underline;" class="">http://lists.ovirt.org/mailman/listinfo/devel</a></span></p></div></div></div></div></blockquote></div><br class=""></body></html>