| 1 |
.\" Copyright (C) 1994, 1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright (C) , Andries Brouwer <[email protected]> |
| 4 |
.\" Copyright (C) 2023, Alejandro Colomar <[email protected]> |
| 5 |
.\" |
| 6 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 7 |
.\" |
| 8 |
.TH proc_sys_kernel 5 2024-05-02 "Linux man-pages 6.9.1" |
| 9 |
.SH NAME |
| 10 |
/proc/sys/kernel/ \- control a range of kernel parameters |
| 11 |
.SH DESCRIPTION |
| 12 |
.TP |
| 13 |
.I /proc/sys/kernel/ |
| 14 |
This directory contains files controlling a range of kernel parameters, |
| 15 |
as described below. |
| 16 |
.TP |
| 17 |
.I /proc/sys/kernel/acct |
| 18 |
This file |
| 19 |
contains three numbers: |
| 20 |
.IR highwater , |
| 21 |
.IR lowwater , |
| 22 |
and |
| 23 |
.IR frequency . |
| 24 |
If BSD-style process accounting is enabled, these values control |
| 25 |
its behavior. |
| 26 |
If free space on filesystem where the log lives goes below |
| 27 |
.I lowwater |
| 28 |
percent, accounting suspends. |
| 29 |
If free space gets above |
| 30 |
.I highwater |
| 31 |
percent, accounting resumes. |
| 32 |
.I frequency |
| 33 |
determines |
| 34 |
how often the kernel checks the amount of free space (value is in |
| 35 |
seconds). |
| 36 |
Default values are 4, 2, and 30. |
| 37 |
That is, suspend accounting if 2% or less space is free; resume it |
| 38 |
if 4% or more space is free; consider information about amount of free space |
| 39 |
valid for 30 seconds. |
| 40 |
.TP |
| 41 |
.IR /proc/sys/kernel/auto_msgmni " (Linux 2.6.27 to Linux 3.18)" |
| 42 |
.\" commit 9eefe520c814f6f62c5d36a2ddcd3fb99dfdb30e (introduces feature) |
| 43 |
.\" commit 0050ee059f7fc86b1df2527aaa14ed5dc72f9973 (rendered redundant) |
| 44 |
From Linux 2.6.27 to Linux 3.18, |
| 45 |
this file was used to control recomputing of the value in |
| 46 |
.I /proc/sys/kernel/msgmni |
| 47 |
upon the addition or removal of memory or upon IPC namespace creation/removal. |
| 48 |
Echoing "1" into this file enabled |
| 49 |
.I msgmni |
| 50 |
automatic recomputing (and triggered a recomputation of |
| 51 |
.I msgmni |
| 52 |
based on the current amount of available memory and number of IPC namespaces). |
| 53 |
Echoing "0" disabled automatic recomputing. |
| 54 |
(Automatic recomputing was also disabled if a value was explicitly assigned to |
| 55 |
.IR /proc/sys/kernel/msgmni .) |
| 56 |
The default value in |
| 57 |
.I auto_msgmni |
| 58 |
was 1. |
| 59 |
.IP |
| 60 |
Since Linux 3.19, the content of this file has no effect (because |
| 61 |
.I msgmni |
| 62 |
.\" FIXME Must document the 3.19 'msgmni' changes. |
| 63 |
defaults to near the maximum value possible), |
| 64 |
and reads from this file always return the value "0". |
| 65 |
.TP |
| 66 |
.IR /proc/sys/kernel/cap_last_cap " (since Linux 3.2)" |
| 67 |
See |
| 68 |
.BR capabilities (7). |
| 69 |
.TP |
| 70 |
.IR /proc/sys/kernel/cap\-bound " (from Linux 2.2 to Linux 2.6.24)" |
| 71 |
This file holds the value of the kernel |
| 72 |
.I "capability bounding set" |
| 73 |
(expressed as a signed decimal number). |
| 74 |
This set is ANDed against the capabilities permitted to a process |
| 75 |
during |
| 76 |
.BR execve (2). |
| 77 |
Starting with Linux 2.6.25, |
| 78 |
the system-wide capability bounding set disappeared, |
| 79 |
and was replaced by a per-thread bounding set; see |
| 80 |
.BR capabilities (7). |
| 81 |
.TP |
| 82 |
.I /proc/sys/kernel/core_pattern |
| 83 |
See |
| 84 |
.BR core (5). |
| 85 |
.TP |
| 86 |
.I /proc/sys/kernel/core_pipe_limit |
| 87 |
See |
| 88 |
.BR core (5). |
| 89 |
.TP |
| 90 |
.I /proc/sys/kernel/core_uses_pid |
| 91 |
See |
| 92 |
.BR core (5). |
| 93 |
.TP |
| 94 |
.I /proc/sys/kernel/ctrl\-alt\-del |
| 95 |
This file |
| 96 |
controls the handling of Ctrl-Alt-Del from the keyboard. |
| 97 |
When the value in this file is 0, Ctrl-Alt-Del is trapped and |
| 98 |
sent to the |
| 99 |
.BR init (1) |
| 100 |
program to handle a graceful restart. |
| 101 |
When the value is greater than zero, Linux's reaction to a Vulcan |
| 102 |
Nerve Pinch (tm) will be an immediate reboot, without even |
| 103 |
syncing its dirty buffers. |
| 104 |
Note: when a program (like dosemu) has the keyboard in "raw" |
| 105 |
mode, the Ctrl-Alt-Del is intercepted by the program before it |
| 106 |
ever reaches the kernel tty layer, and it's up to the program |
| 107 |
to decide what to do with it. |
| 108 |
.TP |
| 109 |
.IR /proc/sys/kernel/dmesg_restrict " (since Linux 2.6.37)" |
| 110 |
The value in this file determines who can see kernel syslog contents. |
| 111 |
A value of 0 in this file imposes no restrictions. |
| 112 |
If the value is 1, only privileged users can read the kernel syslog. |
| 113 |
(See |
| 114 |
.BR syslog (2) |
| 115 |
for more details.) |
| 116 |
Since Linux 3.4, |
| 117 |
.\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8 |
| 118 |
only users with the |
| 119 |
.B CAP_SYS_ADMIN |
| 120 |
capability may change the value in this file. |
| 121 |
.TP |
| 122 |
.IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname |
| 123 |
can be used to set the NIS/YP domainname and the |
| 124 |
hostname of your box in exactly the same way as the commands |
| 125 |
.BR domainname (1) |
| 126 |
and |
| 127 |
.BR hostname (1), |
| 128 |
that is: |
| 129 |
.IP |
| 130 |
.in +4n |
| 131 |
.EX |
| 132 |
.RB "#" " echo \[aq]darkstar\[aq] > /proc/sys/kernel/hostname" |
| 133 |
.RB "#" " echo \[aq]mydomain\[aq] > /proc/sys/kernel/domainname" |
| 134 |
.EE |
| 135 |
.in |
| 136 |
.IP |
| 137 |
has the same effect as |
| 138 |
.IP |
| 139 |
.in +4n |
| 140 |
.EX |
| 141 |
.RB "#" " hostname \[aq]darkstar\[aq]" |
| 142 |
.RB "#" " domainname \[aq]mydomain\[aq]" |
| 143 |
.EE |
| 144 |
.in |
| 145 |
.IP |
| 146 |
Note, however, that the classic darkstar.frop.org has the |
| 147 |
hostname "darkstar" and DNS (Internet Domain Name Server) |
| 148 |
domainname "frop.org", not to be confused with the NIS (Network |
| 149 |
Information Service) or YP (Yellow Pages) domainname. |
| 150 |
These two |
| 151 |
domain names are in general different. |
| 152 |
For a detailed discussion |
| 153 |
see the |
| 154 |
.BR hostname (1) |
| 155 |
man page. |
| 156 |
.TP |
| 157 |
.I /proc/sys/kernel/hotplug |
| 158 |
This file |
| 159 |
contains the pathname for the hotplug policy agent. |
| 160 |
The default value in this file is |
| 161 |
.IR /sbin/hotplug . |
| 162 |
.TP |
| 163 |
.\" Removed in commit 87f504e5c78b910b0c1d6ffb89bc95e492322c84 (tglx/history.git) |
| 164 |
.IR /proc/sys/kernel/htab\-reclaim " (before Linux 2.4.9.2)" |
| 165 |
(PowerPC only) If this file is set to a nonzero value, |
| 166 |
the PowerPC htab |
| 167 |
.\" removed in commit 1b483a6a7b2998e9c98ad985d7494b9b725bd228, before Linux 2.6.28 |
| 168 |
(see kernel file |
| 169 |
.IR Documentation/powerpc/ppc_htab.txt ) |
| 170 |
is pruned |
| 171 |
each time the system hits the idle loop. |
| 172 |
.TP |
| 173 |
.I /proc/sys/kernel/keys/ |
| 174 |
This directory contains various files that define parameters and limits |
| 175 |
for the key-management facility. |
| 176 |
These files are described in |
| 177 |
.BR keyrings (7). |
| 178 |
.TP |
| 179 |
.IR /proc/sys/kernel/kptr_restrict " (since Linux 2.6.38)" |
| 180 |
.\" 455cd5ab305c90ffc422dd2e0fb634730942b257 |
| 181 |
The value in this file determines whether kernel addresses are exposed via |
| 182 |
.I /proc |
| 183 |
files and other interfaces. |
| 184 |
A value of 0 in this file imposes no restrictions. |
| 185 |
If the value is 1, kernel pointers printed using the |
| 186 |
.I %pK |
| 187 |
format specifier will be replaced with zeros unless the user has the |
| 188 |
.B CAP_SYSLOG |
| 189 |
capability. |
| 190 |
If the value is 2, kernel pointers printed using the |
| 191 |
.I %pK |
| 192 |
format specifier will be replaced with zeros regardless |
| 193 |
of the user's capabilities. |
| 194 |
The initial default value for this file was 1, |
| 195 |
but the default was changed |
| 196 |
.\" commit 411f05f123cbd7f8aa1edcae86970755a6e2a9d9 |
| 197 |
to 0 in Linux 2.6.39. |
| 198 |
Since Linux 3.4, |
| 199 |
.\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8 |
| 200 |
only users with the |
| 201 |
.B CAP_SYS_ADMIN |
| 202 |
capability can change the value in this file. |
| 203 |
.TP |
| 204 |
.I /proc/sys/kernel/l2cr |
| 205 |
(PowerPC only) This file |
| 206 |
contains a flag that controls the L2 cache of G3 processor |
| 207 |
boards. |
| 208 |
If 0, the cache is disabled. |
| 209 |
Enabled if nonzero. |
| 210 |
.TP |
| 211 |
.I /proc/sys/kernel/modprobe |
| 212 |
This file contains the pathname for the kernel module loader. |
| 213 |
The default value is |
| 214 |
.IR /sbin/modprobe . |
| 215 |
The file is present only if the kernel is built with the |
| 216 |
.B CONFIG_MODULES |
| 217 |
.RB ( CONFIG_KMOD |
| 218 |
in Linux 2.6.26 and earlier) |
| 219 |
option enabled. |
| 220 |
It is described by the Linux kernel source file |
| 221 |
.I Documentation/kmod.txt |
| 222 |
(present only in Linux 2.4 and earlier). |
| 223 |
.TP |
| 224 |
.IR /proc/sys/kernel/modules_disabled " (since Linux 2.6.31)" |
| 225 |
.\" 3d43321b7015387cfebbe26436d0e9d299162ea1 |
| 226 |
.\" From Documentation/sysctl/kernel.txt |
| 227 |
A toggle value indicating if modules are allowed to be loaded |
| 228 |
in an otherwise modular kernel. |
| 229 |
This toggle defaults to off (0), but can be set true (1). |
| 230 |
Once true, modules can be neither loaded nor unloaded, |
| 231 |
and the toggle cannot be set back to false. |
| 232 |
The file is present only if the kernel is built with the |
| 233 |
.B CONFIG_MODULES |
| 234 |
option enabled. |
| 235 |
.TP |
| 236 |
.IR /proc/sys/kernel/msgmax " (since Linux 2.2)" |
| 237 |
This file defines |
| 238 |
a system-wide limit specifying the maximum number of bytes in |
| 239 |
a single message written on a System V message queue. |
| 240 |
.TP |
| 241 |
.IR /proc/sys/kernel/msgmni " (since Linux 2.4)" |
| 242 |
This file defines the system-wide limit on the number of |
| 243 |
message queue identifiers. |
| 244 |
See also |
| 245 |
.IR /proc/sys/kernel/auto_msgmni . |
| 246 |
.TP |
| 247 |
.IR /proc/sys/kernel/msgmnb " (since Linux 2.2)" |
| 248 |
This file defines a system-wide parameter used to initialize the |
| 249 |
.I msg_qbytes |
| 250 |
setting for subsequently created message queues. |
| 251 |
The |
| 252 |
.I msg_qbytes |
| 253 |
setting specifies the maximum number of bytes that may be written to the |
| 254 |
message queue. |
| 255 |
.TP |
| 256 |
.IR /proc/sys/kernel/ngroups_max " (since Linux 2.6.4)" |
| 257 |
This is a read-only file that displays the upper limit on the |
| 258 |
number of a process's group memberships. |
| 259 |
.TP |
| 260 |
.IR /proc/sys/kernel/ns_last_pid " (since Linux 3.3)" |
| 261 |
See |
| 262 |
.BR pid_namespaces (7). |
| 263 |
.TP |
| 264 |
.IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease |
| 265 |
These files |
| 266 |
give substrings of |
| 267 |
.IR /proc/version . |
| 268 |
.TP |
| 269 |
.IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid |
| 270 |
These files duplicate the files |
| 271 |
.I /proc/sys/fs/overflowgid |
| 272 |
and |
| 273 |
.IR /proc/sys/fs/overflowuid . |
| 274 |
.TP |
| 275 |
.I /proc/sys/kernel/panic |
| 276 |
This file gives read/write access to the kernel variable |
| 277 |
.IR panic_timeout . |
| 278 |
If this is zero, the kernel will loop on a panic; if nonzero, |
| 279 |
it indicates that the kernel should autoreboot after this number |
| 280 |
of seconds. |
| 281 |
When you use the |
| 282 |
software watchdog device driver, the recommended setting is 60. |
| 283 |
.TP |
| 284 |
.IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)" |
| 285 |
This file controls the kernel's behavior when an oops |
| 286 |
or BUG is encountered. |
| 287 |
If this file contains 0, then the system |
| 288 |
tries to continue operation. |
| 289 |
If it contains 1, then the system |
| 290 |
delays a few seconds (to give klogd time to record the oops output) |
| 291 |
and then panics. |
| 292 |
If the |
| 293 |
.I /proc/sys/kernel/panic |
| 294 |
file is also nonzero, then the machine will be rebooted. |
| 295 |
.TP |
| 296 |
.IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)" |
| 297 |
This file specifies the value at which PIDs wrap around |
| 298 |
(i.e., the value in this file is one greater than the maximum PID). |
| 299 |
PIDs greater than this value are not allocated; |
| 300 |
thus, the value in this file also acts as a system-wide limit |
| 301 |
on the total number of processes and threads. |
| 302 |
The default value for this file, 32768, |
| 303 |
results in the same range of PIDs as on earlier kernels. |
| 304 |
On 32-bit platforms, 32768 is the maximum value for |
| 305 |
.IR pid_max . |
| 306 |
On 64-bit systems, |
| 307 |
.I pid_max |
| 308 |
can be set to any value up to 2\[ha]22 |
| 309 |
.RB ( PID_MAX_LIMIT , |
| 310 |
approximately 4 million). |
| 311 |
.\" Prior to Linux 2.6.10, pid_max could also be raised above 32768 on 32-bit |
| 312 |
.\" platforms, but this broke /proc/[pid] |
| 313 |
.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2 |
| 314 |
.TP |
| 315 |
.IR /proc/sys/kernel/powersave\-nap " (PowerPC only)" |
| 316 |
This file contains a flag. |
| 317 |
If set, Linux-PPC will use the "nap" mode of |
| 318 |
powersaving, |
| 319 |
otherwise the "doze" mode will be used. |
| 320 |
.TP |
| 321 |
.I /proc/sys/kernel/printk |
| 322 |
See |
| 323 |
.BR syslog (2). |
| 324 |
.TP |
| 325 |
.IR /proc/sys/kernel/pty " (since Linux 2.6.4)" |
| 326 |
This directory contains two files relating to the number of UNIX 98 |
| 327 |
pseudoterminals (see |
| 328 |
.BR pts (4)) |
| 329 |
on the system. |
| 330 |
.TP |
| 331 |
.I /proc/sys/kernel/pty/max |
| 332 |
This file defines the maximum number of pseudoterminals. |
| 333 |
.\" FIXME Document /proc/sys/kernel/pty/reserve |
| 334 |
.\" New in Linux 3.3 |
| 335 |
.\" commit e9aba5158a80098447ff207a452a3418ae7ee386 |
| 336 |
.TP |
| 337 |
.I /proc/sys/kernel/pty/nr |
| 338 |
This read-only file |
| 339 |
indicates how many pseudoterminals are currently in use. |
| 340 |
.TP |
| 341 |
.I /proc/sys/kernel/random/ |
| 342 |
This directory |
| 343 |
contains various parameters controlling the operation of the file |
| 344 |
.IR /dev/random . |
| 345 |
See |
| 346 |
.BR random (4) |
| 347 |
for further information. |
| 348 |
.TP |
| 349 |
.IR /proc/sys/kernel/random/uuid " (since Linux 2.4)" |
| 350 |
Each read from this read-only file returns a randomly generated 128-bit UUID, |
| 351 |
as a string in the standard UUID format. |
| 352 |
.TP |
| 353 |
.IR /proc/sys/kernel/randomize_va_space " (since Linux 2.6.12)" |
| 354 |
.\" Some further details can be found in Documentation/sysctl/kernel.txt |
| 355 |
Select the address space layout randomization (ASLR) policy for the system |
| 356 |
(on architectures that support ASLR). |
| 357 |
Three values are supported for this file: |
| 358 |
.RS |
| 359 |
.TP |
| 360 |
.B 0 |
| 361 |
Turn ASLR off. |
| 362 |
This is the default for architectures that don't support ASLR, |
| 363 |
and when the kernel is booted with the |
| 364 |
.I norandmaps |
| 365 |
parameter. |
| 366 |
.TP |
| 367 |
.B 1 |
| 368 |
Make the addresses of |
| 369 |
.BR mmap (2) |
| 370 |
allocations, the stack, and the VDSO page randomized. |
| 371 |
Among other things, this means that shared libraries will be |
| 372 |
loaded at randomized addresses. |
| 373 |
The text segment of PIE-linked binaries will also be loaded |
| 374 |
at a randomized address. |
| 375 |
This value is the default if the kernel was configured with |
| 376 |
.BR CONFIG_COMPAT_BRK . |
| 377 |
.TP |
| 378 |
.B 2 |
| 379 |
(Since Linux 2.6.25) |
| 380 |
.\" commit c1d171a002942ea2d93b4fbd0c9583c56fce0772 |
| 381 |
Also support heap randomization. |
| 382 |
This value is the default if the kernel was not configured with |
| 383 |
.BR CONFIG_COMPAT_BRK . |
| 384 |
.RE |
| 385 |
.TP |
| 386 |
.I /proc/sys/kernel/real\-root\-dev |
| 387 |
This file is documented in the Linux kernel source file |
| 388 |
.I Documentation/admin\-guide/initrd.rst |
| 389 |
.\" commit 9d85025b0418163fae079c9ba8f8445212de8568 |
| 390 |
(or |
| 391 |
.I Documentation/initrd.txt |
| 392 |
before Linux 4.10). |
| 393 |
.TP |
| 394 |
.IR /proc/sys/kernel/reboot\-cmd " (Sparc only)" |
| 395 |
This file seems to be a way to give an argument to the SPARC |
| 396 |
ROM/Flash boot loader. |
| 397 |
Maybe to tell it what to do after |
| 398 |
rebooting? |
| 399 |
.TP |
| 400 |
.I /proc/sys/kernel/rtsig\-max |
| 401 |
(Up to and including Linux 2.6.7; see |
| 402 |
.BR setrlimit (2)) |
| 403 |
This file can be used to tune the maximum number |
| 404 |
of POSIX real-time (queued) signals that can be outstanding |
| 405 |
in the system. |
| 406 |
.TP |
| 407 |
.I /proc/sys/kernel/rtsig\-nr |
| 408 |
(Up to and including Linux 2.6.7.) |
| 409 |
This file shows the number of POSIX real-time signals currently queued. |
| 410 |
.TP |
| 411 |
.IR /proc/ pid /sched_autogroup_enabled " (since Linux 2.6.38)" |
| 412 |
.\" commit 5091faa449ee0b7d73bc296a93bca9540fc51d0a |
| 413 |
See |
| 414 |
.BR sched (7). |
| 415 |
.TP |
| 416 |
.IR /proc/sys/kernel/sched_child_runs_first " (since Linux 2.6.23)" |
| 417 |
If this file contains the value zero, then, after a |
| 418 |
.BR fork (2), |
| 419 |
the parent is first scheduled on the CPU. |
| 420 |
If the file contains a nonzero value, |
| 421 |
then the child is scheduled first on the CPU. |
| 422 |
(Of course, on a multiprocessor system, |
| 423 |
the parent and the child might both immediately be scheduled on a CPU.) |
| 424 |
.TP |
| 425 |
.IR /proc/sys/kernel/sched_rr_timeslice_ms " (since Linux 3.9)" |
| 426 |
See |
| 427 |
.BR sched_rr_get_interval (2). |
| 428 |
.TP |
| 429 |
.IR /proc/sys/kernel/sched_rt_period_us " (since Linux 2.6.25)" |
| 430 |
See |
| 431 |
.BR sched (7). |
| 432 |
.TP |
| 433 |
.IR /proc/sys/kernel/sched_rt_runtime_us " (since Linux 2.6.25)" |
| 434 |
See |
| 435 |
.BR sched (7). |
| 436 |
.TP |
| 437 |
.IR /proc/sys/kernel/seccomp/ " (since Linux 4.14)" |
| 438 |
.\" commit 8e5f1ad116df6b0de65eac458d5e7c318d1c05af |
| 439 |
This directory provides additional seccomp information and |
| 440 |
configuration. |
| 441 |
See |
| 442 |
.BR seccomp (2) |
| 443 |
for further details. |
| 444 |
.TP |
| 445 |
.IR /proc/sys/kernel/sem " (since Linux 2.4)" |
| 446 |
This file contains 4 numbers defining limits for System V IPC semaphores. |
| 447 |
These fields are, in order: |
| 448 |
.RS |
| 449 |
.TP |
| 450 |
SEMMSL |
| 451 |
The maximum semaphores per semaphore set. |
| 452 |
.TP |
| 453 |
SEMMNS |
| 454 |
A system-wide limit on the number of semaphores in all semaphore sets. |
| 455 |
.TP |
| 456 |
SEMOPM |
| 457 |
The maximum number of operations that may be specified in a |
| 458 |
.BR semop (2) |
| 459 |
call. |
| 460 |
.TP |
| 461 |
SEMMNI |
| 462 |
A system-wide limit on the maximum number of semaphore identifiers. |
| 463 |
.RE |
| 464 |
.TP |
| 465 |
.I /proc/sys/kernel/sg\-big\-buff |
| 466 |
This file |
| 467 |
shows the size of the generic SCSI device (sg) buffer. |
| 468 |
You can't tune it just yet, but you could change it at |
| 469 |
compile time by editing |
| 470 |
.I include/scsi/sg.h |
| 471 |
and changing |
| 472 |
the value of |
| 473 |
.BR SG_BIG_BUFF . |
| 474 |
However, there shouldn't be any reason to change this value. |
| 475 |
.TP |
| 476 |
.IR /proc/sys/kernel/shm_rmid_forced " (since Linux 3.1)" |
| 477 |
.\" commit b34a6b1da371ed8af1221459a18c67970f7e3d53 |
| 478 |
.\" See also Documentation/sysctl/kernel.txt |
| 479 |
If this file is set to 1, all System V shared memory segments will |
| 480 |
be marked for destruction as soon as the number of attached processes |
| 481 |
falls to zero; |
| 482 |
in other words, it is no longer possible to create shared memory segments |
| 483 |
that exist independently of any attached process. |
| 484 |
.IP |
| 485 |
The effect is as though a |
| 486 |
.BR shmctl (2) |
| 487 |
.B IPC_RMID |
| 488 |
is performed on all existing segments as well as all segments |
| 489 |
created in the future (until this file is reset to 0). |
| 490 |
Note that existing segments that are attached to no process will be |
| 491 |
immediately destroyed when this file is set to 1. |
| 492 |
Setting this option will also destroy segments that were created, |
| 493 |
but never attached, |
| 494 |
upon termination of the process that created the segment with |
| 495 |
.BR shmget (2). |
| 496 |
.IP |
| 497 |
Setting this file to 1 provides a way of ensuring that |
| 498 |
all System V shared memory segments are counted against the |
| 499 |
resource usage and resource limits (see the description of |
| 500 |
.B RLIMIT_AS |
| 501 |
in |
| 502 |
.BR getrlimit (2)) |
| 503 |
of at least one process. |
| 504 |
.IP |
| 505 |
Because setting this file to 1 produces behavior that is nonstandard |
| 506 |
and could also break existing applications, |
| 507 |
the default value in this file is 0. |
| 508 |
Set this file to 1 only if you have a good understanding |
| 509 |
of the semantics of the applications using |
| 510 |
System V shared memory on your system. |
| 511 |
.TP |
| 512 |
.IR /proc/sys/kernel/shmall " (since Linux 2.2)" |
| 513 |
This file |
| 514 |
contains the system-wide limit on the total number of pages of |
| 515 |
System V shared memory. |
| 516 |
.TP |
| 517 |
.IR /proc/sys/kernel/shmmax " (since Linux 2.2)" |
| 518 |
This file |
| 519 |
can be used to query and set the run-time limit |
| 520 |
on the maximum (System V IPC) shared memory segment size that can be |
| 521 |
created. |
| 522 |
Shared memory segments up to 1 GB are now supported in the |
| 523 |
kernel. |
| 524 |
This value defaults to |
| 525 |
.BR SHMMAX . |
| 526 |
.TP |
| 527 |
.IR /proc/sys/kernel/shmmni " (since Linux 2.4)" |
| 528 |
This file |
| 529 |
specifies the system-wide maximum number of System V shared memory |
| 530 |
segments that can be created. |
| 531 |
.TP |
| 532 |
.IR /proc/sys/kernel/sysctl_writes_strict " (since Linux 3.16)" |
| 533 |
.\" commit f88083005ab319abba5d0b2e4e997558245493c8 |
| 534 |
.\" commit 2ca9bb456ada8bcbdc8f77f8fc78207653bbaa92 |
| 535 |
.\" commit f4aacea2f5d1a5f7e3154e967d70cf3f711bcd61 |
| 536 |
.\" commit 24fe831c17ab8149413874f2fd4e5c8a41fcd294 |
| 537 |
The value in this file determines how the file offset affects |
| 538 |
the behavior of updating entries in files under |
| 539 |
.IR /proc/sys . |
| 540 |
The file has three possible values: |
| 541 |
.RS |
| 542 |
.TP 4 |
| 543 |
\-1 |
| 544 |
This provides legacy handling, with no printk warnings. |
| 545 |
Each |
| 546 |
.BR write (2) |
| 547 |
must fully contain the value to be written, |
| 548 |
and multiple writes on the same file descriptor |
| 549 |
will overwrite the entire value, regardless of the file position. |
| 550 |
.TP |
| 551 |
0 |
| 552 |
(default) This provides the same behavior as for \-1, |
| 553 |
but printk warnings are written for processes that |
| 554 |
perform writes when the file offset is not 0. |
| 555 |
.TP |
| 556 |
1 |
| 557 |
Respect the file offset when writing strings into |
| 558 |
.I /proc/sys |
| 559 |
files. |
| 560 |
Multiple writes will |
| 561 |
.I append |
| 562 |
to the value buffer. |
| 563 |
Anything written beyond the maximum length |
| 564 |
of the value buffer will be ignored. |
| 565 |
Writes to numeric |
| 566 |
.I /proc/sys |
| 567 |
entries must always be at file offset 0 and the value must be |
| 568 |
fully contained in the buffer provided to |
| 569 |
.BR write (2). |
| 570 |
.\" FIXME . |
| 571 |
.\" With /proc/sys/kernel/sysctl_writes_strict==1, writes at an |
| 572 |
.\" offset other than 0 do not generate an error. Instead, the |
| 573 |
.\" write() succeeds, but the file is left unmodified. |
| 574 |
.\" This is surprising. The behavior may change in the future. |
| 575 |
.\" See thread.gmane.org/gmane.linux.man/9197 |
| 576 |
.\" From: Michael Kerrisk (man-pages <mtk.manpages@...> |
| 577 |
.\" Subject: sysctl_writes_strict documentation + an oddity? |
| 578 |
.\" Newsgroups: gmane.linux.man, gmane.linux.kernel |
| 579 |
.\" Date: 2015-05-09 08:54:11 GMT |
| 580 |
.RE |
| 581 |
.TP |
| 582 |
.I /proc/sys/kernel/sysrq |
| 583 |
This file controls the functions allowed to be invoked by the SysRq key. |
| 584 |
By default, |
| 585 |
the file contains 1 meaning that every possible SysRq request is allowed |
| 586 |
(in older kernel versions, SysRq was disabled by default, |
| 587 |
and you were required to specifically enable it at run-time, |
| 588 |
but this is not the case any more). |
| 589 |
Possible values in this file are: |
| 590 |
.RS |
| 591 |
.TP 5 |
| 592 |
0 |
| 593 |
Disable sysrq completely |
| 594 |
.TP |
| 595 |
1 |
| 596 |
Enable all functions of sysrq |
| 597 |
.TP |
| 598 |
> 1 |
| 599 |
Bit mask of allowed sysrq functions, as follows: |
| 600 |
.PD 0 |
| 601 |
.RS |
| 602 |
.TP 5 |
| 603 |
\ \ 2 |
| 604 |
Enable control of console logging level |
| 605 |
.TP |
| 606 |
\ \ 4 |
| 607 |
Enable control of keyboard (SAK, unraw) |
| 608 |
.TP |
| 609 |
\ \ 8 |
| 610 |
Enable debugging dumps of processes etc. |
| 611 |
.TP |
| 612 |
\ 16 |
| 613 |
Enable sync command |
| 614 |
.TP |
| 615 |
\ 32 |
| 616 |
Enable remount read-only |
| 617 |
.TP |
| 618 |
\ 64 |
| 619 |
Enable signaling of processes (term, kill, oom-kill) |
| 620 |
.TP |
| 621 |
128 |
| 622 |
Allow reboot/poweroff |
| 623 |
.TP |
| 624 |
256 |
| 625 |
Allow nicing of all real-time tasks |
| 626 |
.RE |
| 627 |
.PD |
| 628 |
.RE |
| 629 |
.IP |
| 630 |
This file is present only if the |
| 631 |
.B CONFIG_MAGIC_SYSRQ |
| 632 |
kernel configuration option is enabled. |
| 633 |
For further details see the Linux kernel source file |
| 634 |
.I Documentation/admin\-guide/sysrq.rst |
| 635 |
.\" commit 9d85025b0418163fae079c9ba8f8445212de8568 |
| 636 |
(or |
| 637 |
.I Documentation/sysrq.txt |
| 638 |
before Linux 4.10). |
| 639 |
.TP |
| 640 |
.I /proc/sys/kernel/version |
| 641 |
This file contains a string such as: |
| 642 |
.IP |
| 643 |
.in +4n |
| 644 |
.EX |
| 645 |
#5 Wed Feb 25 21:49:24 MET 1998 |
| 646 |
.EE |
| 647 |
.in |
| 648 |
.IP |
| 649 |
The "#5" means that |
| 650 |
this is the fifth kernel built from this source base and the |
| 651 |
date following it indicates the time the kernel was built. |
| 652 |
.TP |
| 653 |
.IR /proc/sys/kernel/threads\-max " (since Linux 2.3.11)" |
| 654 |
.\" The following is based on Documentation/sysctl/kernel.txt |
| 655 |
This file specifies the system-wide limit on the number of |
| 656 |
threads (tasks) that can be created on the system. |
| 657 |
.IP |
| 658 |
Since Linux 4.1, |
| 659 |
.\" commit 230633d109e35b0a24277498e773edeb79b4a331 |
| 660 |
the value that can be written to |
| 661 |
.I threads\-max |
| 662 |
is bounded. |
| 663 |
The minimum value that can be written is 20. |
| 664 |
The maximum value that can be written is given by the |
| 665 |
constant |
| 666 |
.B FUTEX_TID_MASK |
| 667 |
(0x3fffffff). |
| 668 |
If a value outside of this range is written to |
| 669 |
.IR threads\-max , |
| 670 |
the error |
| 671 |
.B EINVAL |
| 672 |
occurs. |
| 673 |
.IP |
| 674 |
The value written is checked against the available RAM pages. |
| 675 |
If the thread structures would occupy too much (more than 1/8th) |
| 676 |
of the available RAM pages, |
| 677 |
.I threads\-max |
| 678 |
is reduced accordingly. |
| 679 |
.TP |
| 680 |
.IR /proc/sys/kernel/yama/ptrace_scope " (since Linux 3.5)" |
| 681 |
See |
| 682 |
.BR ptrace (2). |
| 683 |
.TP |
| 684 |
.IR /proc/sys/kernel/zero\-paged " (PowerPC only)" |
| 685 |
This file |
| 686 |
contains a flag. |
| 687 |
When enabled (nonzero), Linux-PPC will pre-zero pages in |
| 688 |
the idle loop, possibly speeding up get_free_pages. |
| 689 |
.SH SEE ALSO |
| 690 |
.BR proc (5), |
| 691 |
.BR proc_sys (5) |