proc.rst (0f69403d2535ffc7200a8414cf3ca66a49b0d741) | proc.rst (565dbe723f6a0126aff747194cda6bc373748316) |
---|---|
1.. SPDX-License-Identifier: GPL-2.0 2 3==================== 4The /proc Filesystem 5==================== 6 7===================== ======================================= ================ 8/proc/sys Terrehon Bowden <terrehon@pacbell.net>, October 7 1999 --- 531 unchanged lines hidden (view full) --- 540 ht area uses huge tlb pages 541 ar architecture specific flag 542 dd do not include area into core dump 543 sd soft dirty flag 544 mm mixed map area 545 hg huge page advise flag 546 nh no huge page advise flag 547 mg mergable advise flag | 1.. SPDX-License-Identifier: GPL-2.0 2 3==================== 4The /proc Filesystem 5==================== 6 7===================== ======================================= ================ 8/proc/sys Terrehon Bowden <terrehon@pacbell.net>, October 7 1999 --- 531 unchanged lines hidden (view full) --- 540 ht area uses huge tlb pages 541 ar architecture specific flag 542 dd do not include area into core dump 543 sd soft dirty flag 544 mm mixed map area 545 hg huge page advise flag 546 nh no huge page advise flag 547 mg mergable advise flag |
548 bt - arm64 BTI guarded page | 548 bt arm64 BTI guarded page |
549 == ======================================= 550 551Note that there is no guarantee that every flag and associated mnemonic will 552be present in all further kernel releases. Things get changed, the flags may 553be vanished or the reverse -- new added. Interpretation of their meaning 554might change in future as well. So each consumer of these flags has to 555follow each specific kernel version for the exact semantic. 556 --- 1617 unchanged lines hidden (view full) --- 2174gid= defines a group authorized to learn processes information otherwise 2175prohibited by hidepid=. If you use some daemon like identd which needs to learn 2176information about processes information, just add identd to this group. 2177 2178subset=pid hides all top level files and directories in the procfs that 2179are not related to tasks. 2180 21815 Filesystem behavior | 549 == ======================================= 550 551Note that there is no guarantee that every flag and associated mnemonic will 552be present in all further kernel releases. Things get changed, the flags may 553be vanished or the reverse -- new added. Interpretation of their meaning 554might change in future as well. So each consumer of these flags has to 555follow each specific kernel version for the exact semantic. 556 --- 1617 unchanged lines hidden (view full) --- 2174gid= defines a group authorized to learn processes information otherwise 2175prohibited by hidepid=. If you use some daemon like identd which needs to learn 2176information about processes information, just add identd to this group. 2177 2178subset=pid hides all top level files and directories in the procfs that 2179are not related to tasks. 2180 21815 Filesystem behavior |
2182---------------------------- | 2182--------------------------- |
2183 2184Originally, before the advent of pid namepsace, procfs was a global file 2185system. It means that there was only one procfs instance in the system. 2186 2187When pid namespace was added, a separate procfs instance was mounted in 2188each pid namespace. So, procfs mount options are global among all | 2183 2184Originally, before the advent of pid namepsace, procfs was a global file 2185system. It means that there was only one procfs instance in the system. 2186 2187When pid namespace was added, a separate procfs instance was mounted in 2188each pid namespace. So, procfs mount options are global among all |
2189mountpoints within the same namespace. | 2189mountpoints within the same namespace:: |
2190 | 2190 |
2191:: | 2191 # grep ^proc /proc/mounts 2192 proc /proc proc rw,relatime,hidepid=2 0 0 |
2192 | 2193 |
2193# grep ^proc /proc/mounts 2194proc /proc proc rw,relatime,hidepid=2 0 0 | 2194 # strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc 2195 mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 2196 +++ exited with 0 +++ |
2195 | 2197 |
2196# strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc 2197mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 2198+++ exited with 0 +++ | 2198 # grep ^proc /proc/mounts 2199 proc /proc proc rw,relatime,hidepid=2 0 0 2200 proc /tmp/proc proc rw,relatime,hidepid=2 0 0 |
2199 | 2201 |
2200# grep ^proc /proc/mounts 2201proc /proc proc rw,relatime,hidepid=2 0 0 2202proc /tmp/proc proc rw,relatime,hidepid=2 0 0 2203 | |
2204and only after remounting procfs mount options will change at all | 2202and only after remounting procfs mount options will change at all |
2205mountpoints. | 2203mountpoints:: |
2206 | 2204 |
2207# mount -o remount,hidepid=1 -t proc proc /tmp/proc | 2205 # mount -o remount,hidepid=1 -t proc proc /tmp/proc |
2208 | 2206 |
2209# grep ^proc /proc/mounts 2210proc /proc proc rw,relatime,hidepid=1 0 0 2211proc /tmp/proc proc rw,relatime,hidepid=1 0 0 | 2207 # grep ^proc /proc/mounts 2208 proc /proc proc rw,relatime,hidepid=1 0 0 2209 proc /tmp/proc proc rw,relatime,hidepid=1 0 0 |
2212 2213This behavior is different from the behavior of other filesystems. 2214 2215The new procfs behavior is more like other filesystems. Each procfs mount 2216creates a new procfs instance. Mount options affect own procfs instance. 2217It means that it became possible to have several procfs instances | 2210 2211This behavior is different from the behavior of other filesystems. 2212 2213The new procfs behavior is more like other filesystems. Each procfs mount 2214creates a new procfs instance. Mount options affect own procfs instance. 2215It means that it became possible to have several procfs instances |
2218displaying tasks with different filtering options in one pid namespace. | 2216displaying tasks with different filtering options in one pid namespace:: |
2219 | 2217 |
2220# mount -o hidepid=invisible -t proc proc /proc 2221# mount -o hidepid=noaccess -t proc proc /tmp/proc 2222# grep ^proc /proc/mounts 2223proc /proc proc rw,relatime,hidepid=invisible 0 0 2224proc /tmp/proc proc rw,relatime,hidepid=noaccess 0 0 | 2218 # mount -o hidepid=invisible -t proc proc /proc 2219 # mount -o hidepid=noaccess -t proc proc /tmp/proc 2220 # grep ^proc /proc/mounts 2221 proc /proc proc rw,relatime,hidepid=invisible 0 0 2222 proc /tmp/proc proc rw,relatime,hidepid=noaccess 0 0 |