Score:0

Containerd: /proc/PID/cwd is a symlink to / But that's not the root-dir of the node

cn flag
root@k8scp:/proc/1328/cwd# ls -l /proc/1328/cwd
lrwxrwxrwx 1 root root 0 Jan 30 09:44 /proc/1328/cwd -> /

I looks like cwd is a symlink to the rhttps://serverfault.com/questions/1091636/containerd-proc-pid-cwd-is-a-symlink-to-but-thats-not-the-root-dir-of-the-noot directory.

Pid 1328 is a container of containerd of a kubernetes master node.

root@k8scp:~# grep PRETTY /etc/os-release /proc/1328/cwd/etc/os-release 

/etc/os-release:PRETTY_NAME="Ubuntu 20.04.3 LTS"
/proc/1328/cwd/etc/os-release:PRETTY_NAME="Distroless"

This confuses me, since this means that /proc/1328/cwd is not a normal symlink, but a magic thing pointing to the root directory of the container.

How can this be explained.

Up to now I thought a symlink is just a string which can be valid (or an sometimes invalid) path.

Score:1
br flag

/proc/PID/cwd, a symlink to the current working directory of the process. Containers are nothing but processes running in network namespaces.

https://web.mit.edu/rhel-doc/5/RHEL-5-manual/Deployment_Guide-en-US/s1-proc-directories.html

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.