# proc_sys_kernel - control a range of kernel parameters - man(5) - [phpMan]

[_proc_sys_kernel_(5)](https://www.chedong.com/phpMan.php/man/procsyskernel/5/markdown)                       File Formats Manual                      [_proc_sys_kernel_(5)](https://www.chedong.com/phpMan.php/man/procsyskernel/5/markdown)

## NAME
       /proc/sys/kernel/ - control a range of kernel parameters

## DESCRIPTION
       _/proc/sys/kernel/_
              This  directory  contains files controlling a range of kernel parameters, as described
              below.

       _/proc/sys/kernel/acct_
              This file contains three numbers: _highwater_, _lowwater_, and  _frequency_.   If  BSD-style
              process  accounting  is  enabled, these values control its behavior.  If free space on
              filesystem where the log lives goes below _lowwater_ percent, accounting  suspends.   If
              free space gets above _highwater_ percent, accounting resumes.  _frequency_ determines how
              often  the kernel checks the amount of free space (value is in seconds).  Default val‐
              ues are 4, 2, and 30.  That is, suspend accounting if 2% or less space is free; resume
              it if 4% or more space is free; consider information about amount of free space  valid
              for 30 seconds.

       _/proc/sys/kernel/auto_msgmni_ (Linux 2.6.27 to Linux 3.18)
              From  Linux  2.6.27  to  Linux  3.18, this file was used to control recomputing of the
              value in _/proc/sys/kernel/msgmni_ upon the addition or removal of memory  or  upon  IPC
              namespace  creation/removal.   Echoing "1" into this file enabled _msgmni_ automatic re‐
              computing (and triggered a recomputation of _msgmni_ based  on  the  current  amount  of
              available memory and number of IPC namespaces).  Echoing "0" disabled automatic recom‐
              puting.   (Automatic  recomputing was also disabled if a value was explicitly assigned
              to _/proc/sys/kernel/msgmni_.)  The default value in _auto_msgmni_ was 1.

              Since Linux 3.19, the content of this file has no effect (because _msgmni_  defaults  to
              near  the  maximum  value  possible), and reads from this file always return the value
              "0".

       _/proc/sys/kernel/cap_last_cap_ (since Linux 3.2)
              See [**capabilities**(7)](https://www.chedong.com/phpMan.php/man/capabilities/7/markdown).

       _/proc/sys/kernel/cap-bound_ (from Linux 2.2 to Linux 2.6.24)
              This file holds the value of the kernel _capability_ _bounding_ _set_ (expressed as a signed
              decimal number).  This set is ANDed against the capabilities permitted  to  a  process
              during [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown).  Starting with Linux 2.6.25, the system-wide capability bounding set
              disappeared, and was replaced by a per-thread bounding set; see [**capabilities**(7)](https://www.chedong.com/phpMan.php/man/capabilities/7/markdown).

       _/proc/sys/kernel/core_pattern_
              See [**core**(5)](https://www.chedong.com/phpMan.php/man/core/5/markdown).

       _/proc/sys/kernel/core_pipe_limit_
              See [**core**(5)](https://www.chedong.com/phpMan.php/man/core/5/markdown).

       _/proc/sys/kernel/core_uses_pid_
              See [**core**(5)](https://www.chedong.com/phpMan.php/man/core/5/markdown).

       _/proc/sys/kernel/ctrl-alt-del_
              This  file controls the handling of Ctrl-Alt-Del from the keyboard.  When the value in
              this file is 0, Ctrl-Alt-Del is trapped and sent to the [**init**(1)](https://www.chedong.com/phpMan.php/man/init/1/markdown) program  to  handle  a
              graceful  restart.   When the value is greater than zero, Linux's reaction to a Vulcan
              Nerve Pinch (tm) will be an immediate reboot, without even syncing its dirty  buffers.
              Note: when a program (like dosemu) has the keyboard in "raw" mode, the Ctrl-Alt-Del is
              intercepted by the program before it ever reaches the kernel tty layer, and it's up to
              the program to decide what to do with it.

       _/proc/sys/kernel/dmesg_restrict_ (since Linux 2.6.37)
              The value in this file determines who can see kernel syslog contents.  A value of 0 in
              this  file imposes no restrictions.  If the value is 1, only privileged users can read
              the kernel syslog.  (See [**syslog**(2)](https://www.chedong.com/phpMan.php/man/syslog/2/markdown) for more details.)  Since  Linux  3.4,  only  users
              with the **CAP_SYS_ADMIN **capability may change the value in this file.

       _/proc/sys/kernel/domainname_ and _/proc/sys/kernel/hostname_
              can  be  used to set the NIS/YP domainname and the hostname of your box in exactly the
              same way as the commands [**domainname**(1)](https://www.chedong.com/phpMan.php/man/domainname/1/markdown) and [**hostname**(1)](https://www.chedong.com/phpMan.php/man/hostname/1/markdown), that is:

                  # **echo 'darkstar' > /proc/sys/kernel/hostname**
                  # **echo 'mydomain' > /proc/sys/kernel/domainname**

              has the same effect as

                  # **hostname 'darkstar'**
                  # **domainname 'mydomain'**

              Note, however, that the classic darkstar.frop.org has the hostname "darkstar" and  DNS
              (Internet  Domain  Name Server) domainname "frop.org", not to be confused with the NIS
              (Network Information Service) or YP (Yellow Pages) domainname.  These two domain names
              are in general different.  For a detailed discussion see the [**hostname**(1)](https://www.chedong.com/phpMan.php/man/hostname/1/markdown) man page.

       _/proc/sys/kernel/hotplug_
              This file contains the pathname for the hotplug policy agent.  The  default  value  in
              this file is _/sbin/hotplug_.

       _/proc/sys/kernel/htab-reclaim_ (before Linux 2.4.9.2)
              (PowerPC  only)  If  this file is set to a nonzero value, the PowerPC htab (see kernel
              file _Documentation/powerpc/ppc_htab.txt_) is pruned each time the system hits the  idle
              loop.

       _/proc/sys/kernel/keys/_
              This  directory  contains various files that define parameters and limits for the key-
              management facility.  These files are described in [**keyrings**(7)](https://www.chedong.com/phpMan.php/man/keyrings/7/markdown).

       _/proc/sys/kernel/kptr_restrict_ (since Linux 2.6.38)
              The value in this file determines whether kernel addresses are exposed via _/proc_ files
              and other interfaces.  A value of 0 in this file  imposes  no  restrictions.   If  the
              value  is  1,  kernel pointers printed using the _%pK_ format specifier will be replaced
              with zeros unless the user has the **CAP_SYSLOG **capability.  If the value is  2,  kernel
              pointers printed using the _%pK_ format specifier will be replaced with zeros regardless
              of  the  user's  capabilities.  The initial default value for this file was 1, but the
              default was changed to 0 in Linux 2.6.39.   Since  Linux  3.4,  only  users  with  the
              **CAP_SYS_ADMIN **capability can change the value in this file.

       _/proc/sys/kernel/l2cr_
              (PowerPC  only)  This  file contains a flag that controls the L2 cache of G3 processor
              boards.  If 0, the cache is disabled.  Enabled if nonzero.

       _/proc/sys/kernel/modprobe_
              This file contains the pathname for the kernel module loader.  The  default  value  is
              _/sbin/modprobe_.   The file is present only if the kernel is built with the **CONFIG_MOD‐**
              **ULES **(**CONFIG_KMOD **in Linux 2.6.26 and earlier) option enabled.  It is described by the
              Linux kernel source file _Documentation/kmod.txt_ (present only in Linux  2.4  and  ear‐
              lier).

       _/proc/sys/kernel/modules_disabled_ (since Linux 2.6.31)
              A  toggle value indicating if modules are allowed to be loaded in an otherwise modular
              kernel.  This toggle defaults to off (0), but can be set true (1).  Once true, modules
              can be neither loaded nor unloaded, and the toggle cannot be set back to  false.   The
              file is present only if the kernel is built with the **CONFIG_MODULES **option enabled.

       _/proc/sys/kernel/msgmax_ (since Linux 2.2)
              This file defines a system-wide limit specifying the maximum number of bytes in a sin‐
              gle message written on a System V message queue.

       _/proc/sys/kernel/msgmni_ (since Linux 2.4)
              This  file  defines  the system-wide limit on the number of message queue identifiers.
              See also _/proc/sys/kernel/auto_msgmni_.

       _/proc/sys/kernel/msgmnb_ (since Linux 2.2)
              This file defines a system-wide parameter used to initialize  the  _msg_qbytes_  setting
              for subsequently created message queues.  The _msg_qbytes_ setting specifies the maximum
              number of bytes that may be written to the message queue.

       _/proc/sys/kernel/ngroups_max_ (since Linux 2.6.4)
              This  is  a  read-only file that displays the upper limit on the number of a process's
              group memberships.

       _/proc/sys/kernel/ns_last_pid_ (since Linux 3.3)
              See [**pid_namespaces**(7)](https://www.chedong.com/phpMan.php/man/pidnamespaces/7/markdown).

       _/proc/sys/kernel/ostype_ and _/proc/sys/kernel/osrelease_
              These files give substrings of _/proc/version_.

       _/proc/sys/kernel/overflowgid_ and _/proc/sys/kernel/overflowuid_
              These files duplicate the files _/proc/sys/fs/overflowgid_ and _/proc/sys/fs/overflowuid_.

       _/proc/sys/kernel/panic_
              This file gives read/write access to the kernel variable _panic_timeout_.   If  this  is
              zero, the kernel will loop on a panic; if nonzero, it indicates that the kernel should
              autoreboot  after  this  number of seconds.  When you use the software watchdog device
              driver, the recommended setting is 60.

       _/proc/sys/kernel/panic_on_oops_ (since Linux 2.5.68)
              This file controls the kernel's behavior when an oops or BUG is encountered.  If  this
              file  contains 0, then the system tries to continue operation.  If it contains 1, then
              the system delays a few seconds (to give klogd time to record  the  oops  output)  and
              then  panics.   If  the  _/proc/sys/kernel/panic_ file is also nonzero, then the machine
              will be rebooted.

       _/proc/sys/kernel/pid_max_ (since Linux 2.5.34)
              This file specifies the value at which PIDs wrap around (i.e., the value in this  file
              is one greater than the maximum PID).  PIDs greater than this value are not allocated;
              thus,  the  value in this file also acts as a system-wide limit on the total number of
              processes and threads.  The default value for this file, 32768, results  in  the  same
              range  of PIDs as on earlier kernels.  On 32-bit platforms, 32768 is the maximum value
              for _pid_max_.  On 64-bit  systems,  _pid_max_  can  be  set  to  any  value  up  to  2^22
              (**PID_MAX_LIMIT**, approximately 4 million).

       _/proc/sys/kernel/powersave-nap_ (PowerPC only)
              This  file contains a flag.  If set, Linux-PPC will use the "nap" mode of powersaving,
              otherwise the "doze" mode will be used.

       _/proc/sys/kernel/printk_
              See [**syslog**(2)](https://www.chedong.com/phpMan.php/man/syslog/2/markdown).

       _/proc/sys/kernel/pty_ (since Linux 2.6.4)
              This directory contains two files relating to the number of  UNIX  98  pseudoterminals
              (see [**pts**(4)](https://www.chedong.com/phpMan.php/man/pts/4/markdown)) on the system.

       _/proc/sys/kernel/pty/max_
              This file defines the maximum number of pseudoterminals.

       _/proc/sys/kernel/pty/nr_
              This read-only file indicates how many pseudoterminals are currently in use.

       _/proc/sys/kernel/random/_
              This  directory  contains  various  parameters  controlling  the operation of the file
              _/dev/random_.  See [**random**(4)](https://www.chedong.com/phpMan.php/man/random/4/markdown) for further information.

       _/proc/sys/kernel/random/uuid_ (since Linux 2.4)
              Each read from this read-only file returns a randomly generated  128-bit  UUID,  as  a
              string in the standard UUID format.

       _/proc/sys/kernel/randomize_va_space_ (since Linux 2.6.12)
              Select  the address space layout randomization (ASLR) policy for the system (on archi‐
              tectures that support ASLR).  Three values are supported for this file:

              **0      **Turn ASLR off.  This is the default for architectures that don't support  ASLR,
                     and when the kernel is booted with the _norandmaps_ parameter.

              **1      **Make the addresses of [**mmap**(2)](https://www.chedong.com/phpMan.php/man/mmap/2/markdown) allocations, the stack, and the VDSO page random‐
                     ized.   Among  other things, this means that shared libraries will be loaded at
                     randomized addresses.  The text segment of PIE-linked  binaries  will  also  be
                     loaded  at  a  randomized address.  This value is the default if the kernel was
                     configured with **CONFIG_COMPAT_BRK**.

              **2      **(Since Linux 2.6.25) Also support heap randomization.  This value  is  the  de‐
                     fault if the kernel was not configured with **CONFIG_COMPAT_BRK**.

       _/proc/sys/kernel/real-root-dev_
              This file is documented in the Linux kernel source file _Documentation/admin-guide/ini‐_
              _trd.rst_ (or _Documentation/initrd.txt_ before Linux 4.10).

       _/proc/sys/kernel/reboot-cmd_ (Sparc only)
              This  file  seems  to be a way to give an argument to the SPARC ROM/Flash boot loader.
              Maybe to tell it what to do after rebooting?

       _/proc/sys/kernel/rtsig-max_
              (Up to and including Linux 2.6.7; see [**setrlimit**(2)](https://www.chedong.com/phpMan.php/man/setrlimit/2/markdown)) This file can be used to tune  the
              maximum number of POSIX real-time (queued) signals that can be outstanding in the sys‐
              tem.

       _/proc/sys/kernel/rtsig-nr_
              (Up to and including Linux 2.6.7.)  This file shows the number of POSIX real-time sig‐
              nals currently queued.

       _/proc/_pid_/sched_autogroup_enabled_ (since Linux 2.6.38)
              See [**sched**(7)](https://www.chedong.com/phpMan.php/man/sched/7/markdown).

       _/proc/sys/kernel/sched_child_runs_first_ (since Linux 2.6.23)
              If  this  file  contains  the  value  zero, then, after a [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown), the parent is first
              scheduled on the CPU.  If the file contains a nonzero value, then the child is  sched‐
              uled  first  on  the  CPU.  (Of course, on a multiprocessor system, the parent and the
              child might both immediately be scheduled on a CPU.)

       _/proc/sys/kernel/sched_rr_timeslice_ms_ (since Linux 3.9)
              See [**sched_rr_get_interval**(2)](https://www.chedong.com/phpMan.php/man/schedrrgetinterval/2/markdown).

       _/proc/sys/kernel/sched_rt_period_us_ (since Linux 2.6.25)
              See [**sched**(7)](https://www.chedong.com/phpMan.php/man/sched/7/markdown).

       _/proc/sys/kernel/sched_rt_runtime_us_ (since Linux 2.6.25)
              See [**sched**(7)](https://www.chedong.com/phpMan.php/man/sched/7/markdown).

       _/proc/sys/kernel/seccomp/_ (since Linux 4.14)
              This directory provides additional seccomp information and  configuration.   See  **sec‐**
              [**comp**(2)](https://www.chedong.com/phpMan.php/man/comp/2/markdown) for further details.

       _/proc/sys/kernel/sem_ (since Linux 2.4)
              This  file  contains  4  numbers  defining  limits for System V IPC semaphores.  These
              fields are, in order:

              SEMMSL The maximum semaphores per semaphore set.

              SEMMNS A system-wide limit on the number of semaphores in all semaphore sets.

              SEMOPM The maximum number of operations that may be specified in a [**semop**(2)](https://www.chedong.com/phpMan.php/man/semop/2/markdown) call.

              SEMMNI A system-wide limit on the maximum number of semaphore identifiers.

       _/proc/sys/kernel/sg-big-buff_
              This file shows the size of the generic SCSI device (sg) buffer.  You  can't  tune  it
              just  yet,  but  you  could change it at compile time by editing _include/scsi/sg.h_ and
              changing the value of **SG_BIG_BUFF**.  However, there shouldn't be any reason  to  change
              this value.

       _/proc/sys/kernel/shm_rmid_forced_ (since Linux 3.1)
              If  this  file is set to 1, all System V shared memory segments will be marked for de‐
              struction as soon as the number of attached processes falls to zero; in  other  words,
              it  is no longer possible to create shared memory segments that exist independently of
              any attached process.

              The effect is as though a [**shmctl**(2)](https://www.chedong.com/phpMan.php/man/shmctl/2/markdown) **IPC_RMID **is performed on all existing segments  as
              well as all segments created in the future (until this file is reset to 0).  Note that
              existing  segments  that are attached to no process will be immediately destroyed when
              this file is set to 1.  Setting this option will also destroy segments that were  cre‐
              ated,  but  never  attached,  upon termination of the process that created the segment
              with [**shmget**(2)](https://www.chedong.com/phpMan.php/man/shmget/2/markdown).

              Setting this file to 1 provides a way of ensuring that all System V shared memory seg‐
              ments are counted against the resource usage and resource limits (see the  description
              of **RLIMIT_AS **in [**getrlimit**(2)](https://www.chedong.com/phpMan.php/man/getrlimit/2/markdown)) of at least one process.

              Because  setting  this  file to 1 produces behavior that is nonstandard and could also
              break existing applications, the default value in this file is 0.  Set this file to  1
              only  if you have a good understanding of the semantics of the applications using Sys‐
              tem V shared memory on your system.

       _/proc/sys/kernel/shmall_ (since Linux 2.2)
              This file contains the system-wide limit on the total number  of  pages  of  System  V
              shared memory.

       _/proc/sys/kernel/shmmax_ (since Linux 2.2)
              This  file  can  be  used to query and set the run-time limit on the maximum (System V
              IPC) shared memory segment size that can be created.  Shared memory segments up  to  1
              GB are now supported in the kernel.  This value defaults to **SHMMAX**.

       _/proc/sys/kernel/shmmni_ (since Linux 2.4)
              This  file specifies the system-wide maximum number of System V shared memory segments
              that can be created.

       _/proc/sys/kernel/sysctl_writes_strict_ (since Linux 3.16)
              The value in this file determines how the file offset affects the behavior of updating
              entries in files under _/proc/sys_.  The file has three possible values:

              -1  This provides legacy handling, with no printk warnings.  Each [**write**(2)](https://www.chedong.com/phpMan.php/man/write/2/markdown) must  fully
                  contain  the  value to be written, and multiple writes on the same file descriptor
                  will overwrite the entire value, regardless of the file position.

              0   (default) This provides the same behavior as for -1, but printk warnings are writ‐
                  ten for processes that perform writes when the file offset is not 0.

              1   Respect the file offset when  writing  strings  into  _/proc/sys_  files.   Multiple
                  writes  will  _append_  to  the  value  buffer.  Anything written beyond the maximum
                  length of the value buffer will be ignored.  Writes to numeric  _/proc/sys_  entries
                  must  always  be  at  file  offset  0 and the value must be fully contained in the
                  buffer provided to [**write**(2)](https://www.chedong.com/phpMan.php/man/write/2/markdown).

       _/proc/sys/kernel/sysrq_
              This file controls the functions allowed to be invoked by the SysRq key.  By  default,
              the  file  contains  1  meaning that every possible SysRq request is allowed (in older
              kernel versions, SysRq was disabled by default, and you were required to  specifically
              enable  it  at  run-time, but this is not the case any more).  Possible values in this
              file are:

              0    Disable sysrq completely

              1    Enable all functions of sysrq

              > 1  Bit mask of allowed sysrq functions, as follows:
                     2  Enable control of console logging level
                     4  Enable control of keyboard (SAK, unraw)
                     8  Enable debugging dumps of processes etc.
                    16  Enable sync command
                    32  Enable remount read-only
                    64  Enable signaling of processes (term, kill, oom-kill)
                   128  Allow reboot/poweroff
                   256  Allow nicing of all real-time tasks

              This file is present only if the **CONFIG_MAGIC_SYSRQ **kernel configuration option is en‐
              abled.  For further  details  see  the  Linux  kernel  source  file  _Documentation/ad‐_
              _min-guide/sysrq.rst_ (or _Documentation/sysrq.txt_ before Linux 4.10).

       _/proc/sys/kernel/version_
              This file contains a string such as:

                  #5 Wed Feb 25 21:49:24 MET 1998

              The  "#5" means that this is the fifth kernel built from this source base and the date
              following it indicates the time the kernel was built.

       _/proc/sys/kernel/threads-max_ (since Linux 2.3.11)
              This file specifies the system-wide limit on the number of threads (tasks) that can be
              created on the system.

              Since Linux 4.1, the value that can be written to _threads-max_ is bounded.  The minimum
              value that can be written is 20.  The maximum value that can be written  is  given  by
              the constant **FUTEX_TID_MASK **(0x3fffffff).  If a value outside of this range is written
              to _threads-max_, the error **EINVAL **occurs.

              The  value  written  is checked against the available RAM pages.  If the thread struc‐
              tures would occupy too much (more than 1/8th) of the available RAM pages,  _threads-max_
              is reduced accordingly.

       _/proc/sys/kernel/yama/ptrace_scope_ (since Linux 3.5)
              See [**ptrace**(2)](https://www.chedong.com/phpMan.php/man/ptrace/2/markdown).

       _/proc/sys/kernel/zero-paged_ (PowerPC only)
              This  file  contains a flag.  When enabled (nonzero), Linux-PPC will pre-zero pages in
              the idle loop, possibly speeding up get_free_pages.

## SEE ALSO
       [**proc**(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown), [**proc_sys**(5)](https://www.chedong.com/phpMan.php/man/procsys/5/markdown)

Linux man-pages 6.7                          2023-09-30                           [_proc_sys_kernel_(5)](https://www.chedong.com/phpMan.php/man/procsyskernel/5/markdown)
