<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi, Chris:</div>
<div><br>
</div>
<div>Thanks a lot for the quick response! I turned the SELinux to "Permissive" mode and now the error messages are different. Seems like the "dnsmasq" process still has hard time to access some files. But the good news is, at least the process started and loaded
 the right files from "/var/lib/quantum/dhcp" directory.</div>
<div><br>
</div>
<div>
<div>dmd@as-net1 ~]$ sudo tail -n 200 /var/log/messages | grep dnsmasq</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.261:42): avc:  denied  { read } for  pid=16963 comm="dnsmasq" name="sh" dev=dm-0 ino=1572867 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=lnk_file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.261:43): avc:  denied  { execute } for  pid=16963 comm="dnsmasq" name="bash" dev=dm-0 ino=1572905 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.261:44): avc:  denied  { read open } for  pid=16963 comm="dnsmasq" name="bash" dev=dm-0 ino=1572905 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.261:45): avc:  denied  { execute_no_trans } for  pid=16963 comm="dnsmasq" path="/bin/bash" dev=dm-0 ino=1572905 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:shell_exec_t:s0
 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.261:46): avc:  denied  { getattr } for  pid=16963 comm="sh" path="/bin/bash" dev=dm-0 ino=1572905 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.262:47): avc:  denied  { execute } for  pid=16963 comm="sh" name="quantum-dhcp-agent-dnsmasq-lease-update" dev=dm-0 ino=2102246 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:bin_t:s0
 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.262:48): avc:  denied  { read open } for  pid=16963 comm="sh" name="quantum-dhcp-agent-dnsmasq-lease-update" dev=dm-0 ino=2102246 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:bin_t:s0
 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 kernel: type=1400 audit(1361209291.262:49): avc:  denied  { execute_no_trans } for  pid=16963 comm="sh" path="/usr/bin/quantum-dhcp-agent-dnsmasq-lease-update" dev=dm-0 ino=2102246 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:bin_t:s0
 tclass=file</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: started, version 2.48 cachesize 150</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: compile time options: IPv6 GNU-getopt DBus no-I18N DHCP TFTP</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: warning: no upstream servers configured</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq-dhcp[16966]: DHCP, static leases only on 192.168.178.0, lease time 2m</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: cleared cache</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: read /var/lib/quantum/dhcp/6462a2a6-28cc-4472-907e-34bf02c9e81e/host</div>
<div>Feb 18 12:41:31 as-net1 dnsmasq[16966]: read /var/lib/quantum/dhcp/6462a2a6-28cc-4472-907e-34bf02c9e81e/opts</div>
<div>[dmd@as-net1 ~]$ </div>
</div>
<div><br>
</div>
<div>Shixiong</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div apple-content-edited="true">
<div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="543" style="width: 407.25pt; position: static; z-index: auto; ">
<tbody>
<tr>
<td style="padding: 0in; ">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="543" style="width: 407.25pt; ">
<tbody>
<tr>
<td style="padding: 0in; ">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">
<span style="color: rgb(54, 95, 145); ">    </span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div>
<div>On Feb 18, 2013, at 3:17 PM, Chris Wright <<a href="mailto:chrisw@redhat.com">chrisw@redhat.com</a>></div>
<div> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">* Shixiong Shang (shshang) (<a href="mailto:shshang@cisco.com">shshang@cisco.com</a>) wrote:<br>
<blockquote type="cite">Hi, guys:<br>
<br>
I am using dnsmasq as DHCP server to assign IP address to VMs. The "dnsmasq" process seemed to start ok.<br>
<br>
nobody    2919     1  0 23:16 ?        00:00:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --local=// --domain-needed --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254
 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override --dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts<br>
</blockquote>
<br>
This is the libvirt dnsmasq for running locally (un)managed libvirt<br>
based VMs, NAT'd to the host interface.<br>
<br>
<blockquote type="cite"><br>
However, I noticed that, all three config files referred by dnsmasq process were all empty. Based on dhcp_agent.ini file, dnsmasq should go to /var/lib/quantum for config files….Why did they load files from /var/lib/libvirt/dnsmasq?<br>
[root@as-net1 bin]# cd /var/lib/libvirt/dnsmasq/<br>
[root@as-net1 dnsmasq]# ls -lh<br>
total 0<br>
-rw-r--r--. 1 root root 0 Feb 17 23:14 default.addnhosts<br>
-rw-r--r--. 1 root root 0 Feb 17 23:14 default.hostsfile<br>
-rw-r--r--. 1 root root 0 Feb  4 10:03 default.leases<br>
<br>
<br>
In addition, system log threw the following error message at the time when I restarted dhcp agent:<br>
<br>
Feb 17 23:37:19 as-net1 kernel: type=1400 audit(1361162239.626:560): avc:  denied  { read } for  pid=13252 comm="dnsmasq" name="sh" dev=dm-0 ino=1572867 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=lnk_file<br>
</blockquote>
<br>
This is SELinux...you can make sure selinux is in permissive mode<br>
<br>
<blockquote type="cite">Feb 17 23:37:19 as-net1 dnsmasq[13251]: cannot run lease-init script /usr/bin/quantum-dhcp-agent-dnsmasq-lease-update: No such file or directory<br>
Feb 17 23:37:19 as-net1 dnsmasq[13251]: FAILED to start up<br>
Feb 17 23:37:22 as-net1 dnsmasq[13297]: cannot run lease-init script /usr/bin/quantum-dhcp-agent-dnsmasq-lease-update: No such file or directory<br>
Feb 17 23:37:22 as-net1 dnsmasq[13297]: FAILED to start up<br>
<br>
When I tried to execute the script manually, it gave me this traceback…..<br>
<br>
[dmd@as-net1 bin]$ /usr/bin/quantum-dhcp-agent-dnsmasq-lease-update<br>
Traceback (most recent call last):<br>
 File "/usr/bin/quantum-dhcp-agent-dnsmasq-lease-update", line 20, in <module><br>
   dhcp.Dnsmasq.lease_update()<br>
 File "/usr/lib/python2.6/site-packages/quantum/agent/linux/dhcp.py", line 341, in lease_update<br>
   action = sys.argv[1]<br>
IndexError: list index out of range<br>
</blockquote>
<br>
This may be related to the above, can take a deeper look shortly.<br>
<br>
thanks,<br>
-chris<br>
</blockquote>
</div>
<br>
</body>
</html>