0

we have linux machine redhat 6

when we print all paramers from /etc/sysctl.conf we see only ~20 but when we perform sysctl -a we see more then 200

so from where sysctl -a print all these parameters ?

or for example

when we do

    sysctl -w variable=value

how to know where variable should be saved ?

second

how to know each parameters if this dynamic or static ?

yael
  • 11
  • 2

1 Answers1

2

The option -a of sysctl prints all available options as stated in the manual.

-a, --all
     Display all values currently available.

These options come from the built-in or loaded Linux kernel modules. Some if not all modules provide some variables that can be tuned via sysctl. The /etc/sysctl.conf includes the variables that have been changed. Any variable uses its default value when not changed.

Please, note that there are multiple files to load system parameters like files under /etc/sysctl.d/.

If you want to know whether a variable can be changed or not, you can look at the corresponding file under /proc/sys. Some files (variables) are read-only while others can be read and written.

Here is an example of one changeable variable (1st one) and one read-only (second) from /proc/sys/kernel/

-rw-r--r-- 1 root root 0 Apr  4 10:23 shmmax
-r--r--r-- 1 root root 0 Apr  4 10:14 version
Khaled
  • 36,533
  • 8
  • 72
  • 99
  • regarding - built-in or loaded Linux kernel modules , how to know the path of this modules , second how to know if variable is statis or dinamic ( dinamic is value that change ) – yael Apr 04 '17 at 07:20
  • in my redhat machine we not have /etc/sysctl.d/ folder – yael Apr 04 '17 at 07:22
  • do you know how to verify if kernel parameter is dynamic ? ( I mean the OS change this value ) – yael Apr 04 '17 at 07:41
  • The kernel documentation on https://www.kernel.org/doc/Documentation/ typically explains the kernel runtime parameters, their default and accepted values. A google search `site:www.kernel.org/doc/Documentation/ ` is often the quickest to find the appropriate manual page. And anything not overruled from the locations explained in `man sysctl` or manually by an administrator with `echo value > /proc/sys/section/module/parameter` or similar should be at the default setting – HBruijn Apr 04 '17 at 07:41
  • yes but I am asking about howto know kernel parameter is dynamic ( that change according to the OS state ? ) – yael Apr 04 '17 at 08:00