procfs (process filesystem) is a virtual filesystem to output and change system and process information. It's generated by the kernel and mounted at /proc. The information in the sysfs filesystem replaces more and more system information of procfs.
You need to activate the following kernel options:
Change your fstab to mount procfs at boot time to /proc:
See the Wikipedia article for the file's purpose.
- Use cat to read the information, e.g. output the version of the currently running kernel:
- To set values at runtime - if possible - use echo, e.g. to enable the magic SysRq key::
sysctl is a mechanism to modify certain kernel parameters at runtime. It is part of procfs and the files are located at /proc/sys/. /usr/src/linux/Documentation/sysctl/ contains documentation of most files.
sysctl work with keys, which can be assembled from the file path by removing the /proc/sys prefix and replace the backsplash with a point. So, e.g. /proc/sys/kernel/sysrq becomes kernel.sysrq.
You can modify at runtime the files like above, but the tool sysctl (part of sys-process/procps) do it in a more structured way:
- To enable the magic sysrq key:
- To show all keys and their current values:
To configure kernel parameters at boot, add them to a .conf file in /etc/sysctl.d/. The recommended location for local settings is /etc/sysctl.d/local.conf. The legacy file /etc/sysctl.conf is also supported. To enable the magic SysRq key at boot:
The service sysctl read the files at boot and execute the settings. The service is enabled by default.
systemd knows beside /etc/sysctl.d/ also /usr/lib/sysctl.d/ for package-provided config files.
The service systemd-sysctl is enabled by default.