0

I inspected the symlinks in an Ubuntu VM for the namespace related directories under /proc/PID/ns. I see all the links are in red color.

enter image description here

I even tried to test using unshare to see if I can create a new namespace. I tested using mount namespace and a new namespace is assigned to the new process.

root@VM:/# ll /proc/$$/ns
total 0
dr-x--x--x 2 root root 0 Apr 21 01:56 ./
dr-xr-xr-x 9 root root 0 Apr 21 01:56 ../
lrwxrwxrwx 1 root root 0 Apr 21 01:56 cgroup -> cgroup:[4026531835]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ** mnt -> mnt:[4026531840] **
lrwxrwxrwx 1 root root 0 Apr 21 01:56 net -> net:[4026531957]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 uts -> uts:[4026531838]
root@VM:/# 
root@VM:/# unshare --mount
root@VM:/# 
root@VM:/# ll /proc/$$/ns
total 0
dr-x--x--x 2 root root 0 Apr 21 01:56 ./
dr-xr-xr-x 9 root root 0 Apr 21 01:56 ../
lrwxrwxrwx 1 root root 0 Apr 21 01:56 cgroup -> cgroup:[4026531835]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ** mnt -> mnt:[4026532226] **
lrwxrwxrwx 1 root root 0 Apr 21 01:56 net -> net:[4026531957]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 uts -> uts:[4026531838]

Can anyone tell why the symlinks are in red ? Does this mean the namespace feature is not working ?

Jake
  • 1,353
  • duplicated of https://unix.stackexchange.com/q/345797/72456 + duplicated of https://askubuntu.com/q/17299/283843 on AU + duplicated of https://superuser.com/q/543397/370509 on SU. – αғsнιη Apr 21 '19 at 06:35

1 Answers1

3

This is ls’ representation of broken symlinks; see What does a red-colored filename mean?

The fact that the links are red, or even that the symlinks are broken, doesn’t imply anything with regard to whether namespaces are working or not; it’s only related to the namespace representation in /proc. The existence of the files means that the corresponding namespaces are set up, and presumably working correctly.

Stephen Kitt
  • 434,908