Also note that the contents of the procfs tree (typically mounted at /proc highly depends on both the operating system and the operating system version. Given any generic Unix-like system, I would expect to find one directory per running process, using the process ID as the directory name, and perhaps tons of OS-specific stuff. Inside the PID directories, I would expect to find even more OS-specific stuff. Note the term "OS-specific stuff", meaning exactly that. An unspecified amount (maybe even zero) of unspecified directory entries.
Just for fun, I've just logged into my pfSense box (currently running pfSense v2.4.4-RELEASE). It is based on FreeBSD 11.2-RELEASE-p3. And guess how /proc looks like there:
[2.4.4-RELEASE][root@pfSense]/root: ls /proc
[2.4.4-RELEASE][root@pfSense]/root: ls -alF /proc
total 8
dr-xr-xr-x 2 root wheel 512 Jul 19 2016 ./
drwxr-xr-x 22 root wheel 1024 Feb 2 17:47 ../
[2.4.4-RELEASE][root@pfSense]/root:
Yes, it's empty, to my surprise. pfSense works fine without it. Now imagine a tool insisting on having data in /proc ...
You can still mount it:
[2.4.4-RELEASE][root@pfSense]/root: mount
/dev/ufsid/5895f1e0f622b3ed on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local)
/dev/md0 on /var/run (ufs, local)
devfs on /var/dhcpd/dev (devfs, local)
[2.4.4-RELEASE][root@pfSense]/root: mount -t procfs proc /proc
[2.4.4-RELEASE][root@pfSense]/root: ls -alF /proc
total 4
dr-xr-xr-x 1 root wheel 0 May 20 23:06 ./
drwxr-xr-x 22 root wheel 1024 Feb 2 17:47 ../
dr-xr-xr-x 1 root wheel 0 May 20 23:06 0/
dr-xr-xr-x 1 root wheel 0 May 20 23:06 1/
dr-xr-xr-x 1 root wheel 0 May 20 23:06 10/
# many directories cut away
dr-xr-xr-x 1 dhcpd _dhcp 0 May 20 23:06 65493/
dr-xr-xr-x 1 root wheel 0 May 20 23:06 7/
dr-xr-xr-x 1 root wheel 0 May 20 23:06 72338/
# more directories cut away
dr-xr-xr-x 1 root wheel 0 May 20 23:06 98163/
lr--r--r-- 1 root wheel 0 May 20 23:06 curproc@ -> 85721
[2.4.4-RELEASE][root@pfSense]/root: ls -alF /proc/7
total 0
dr-xr-xr-x 1 root wheel 0 May 20 23:07 ./
dr-xr-xr-x 1 root wheel 0 May 20 23:07 ../
-r--r--r-- 1 root wheel 0 May 20 23:07 cmdline
--w------- 1 root wheel 0 May 20 23:07 ctl
-r--r--r-- 1 root wheel 0 May 20 23:07 etype
-r--r--r-- 1 root wheel 0 May 20 23:07 rlimit
-r--r--r-- 1 root wheel 0 May 20 23:07 status
[2.4.4-RELEASE][root@pfSense]/root:
Compared with Linux, this is procfs on a strict diet. See also https://www.freebsd.org/doc/en/articles/linux-users/procfs.html.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
|