Comment 5 for bug 1285929

Revision history for this message
Brad Durrow (l-brad) wrote :

Here is another way to calculate the processes id with network ports open (both servers and clients) in a namespace:

[root@fuelpxe01 ~]# ssh node-16 ip netns exec qdhcp-50644057-b518-4e85-843a-3321c9a4073f lsof -i
Warning: Permanently added 'node-16' (RSA) to the list of known hosts.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 9928 nobody 3u IPv4 2507813106 0t0 UDP *:bootps
dnsmasq 9928 nobody 5u IPv4 2507813112 0t0 UDP 10.29.8.2:domain
dnsmasq 9928 nobody 6u IPv4 2507813113 0t0 TCP 10.29.8.2:domain (LISTEN)
dnsmasq 9928 nobody 7u IPv6 2507813114 0t0 UDP [fe80::f816:3eff:fe61:1b64]:domain
dnsmasq 9928 nobody 8u IPv6 2507813115 0t0 TCP [fe80::f816:3eff:fe61:1b64]:domain (LISTEN)

If you only wanted the process id you would add a -t
[root@fuelpxe01 ~]# ssh node-16 ip netns exec qdhcp-50644057-b518-4e85-843a-3321c9a4073f lsof -i -t
Warning: Permanently added 'node-16' (RSA) to the list of known hosts.
9928

I believe you could also use fuser to find the processes and kill them in one step.

This is not appropriate for the l3-agent resource (in the qrouter-* nammespace) as /usr/bin/neutron-ns-metadata-proxy is returned when you run a similiar command in the qrouter namespace.