Advertisement
Guest User

Untitled

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