Tuesday, June 18, 2019

Namespace of processes


Check namespace ID of process.  Can quickly determine if uts namespace collide

$ls -lash /proc/self/ns  
total 0
0 dr-x--x--x. 2  0 Jun 19 01:11 .
0 dr-xr-xr-x. 9  0 Jun 19 01:11 ..
0 lrwxrwxrwx. 1  0 Jun 19 01:11 cgroup -> 'cgroup:[4026531835]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 ipc -> 'ipc:[4026531839]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 mnt -> 'mnt:[4026531840]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 net -> 'net:[4026531992]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 pid -> 'pid:[4026531836]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 pid_for_children -> 'pid:[4026531836]'
0 lrwxrwxrwx. 1  0 Jun 19 01:11 user -> 'user:[4026531837]'

0 lrwxrwxrwx. 1  0 Jun 19 01:11 uts -> 'uts:[4026531838]'

pidof [prog]
ls -lash /proc/[pid]/ns