Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- netns=myns
- find -L /proc/[1-9]*/task/*/ns/net -samefile /run/netns/"$netns" | cut -d/ -f5
- print -l /proc/[1-9]*/task/*/ns/net(e:'[ $REPLY -ef /run/netns/$netns ]'::h:h:t)
- sudo ip netns exec "$netns" socat abstract-listen:test-ns,fork /dev/null &
- ps -eopid= |
- while read p; do
- nsenter -n"/proc/$p/ns/net" socat -u abstract:test-ns - 2> /dev/null &&
- echo "$p"
- done
- netns=mynamespace
- inode=$(ls -i /var/run/netns/$netns | cut -f1 -d" ")
- pids=$(find -L /proc/[1-9]*/task/*/ns/net -inum $inode | cut -f3 -d"/" | uniq)
- ps -p $pids
- PID Namespace Thread/Command
- -- net:[4026533172] created by ip netns add qrouter-c33ffc14-dbc2-4730-b787-4747
- -- net:[4026533112] created by ip netns add qrouter-5a691ed3-f6d3-4346-891a-3b59
- 297 mnt:[4026531856] kdevtmpfs
- 3429 net:[4026533050]** dnsmasq --no-hosts --no-resolv --strict-order --bind-interfa
- 3429 mnt:[4026533108] dnsmasq --no-hosts --no-resolv --strict-order --bind-interfa
- 3486 net:[4026533050]** /usr/bin/python /usr/bin/neutron-ns-metadata-proxy --pid_fil
- 3486 mnt:[4026533107] /usr/bin/python /usr/bin/neutron-ns-metadata-proxy --pid_fil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement