2

The kernel.sysrq setting seems to be often located at /etc/sysctl.d/99-sysctl.conf, however, I do not see this file on my Arch system. Instead, there seems to be a file:

/usr/lib/sysctl.d/50-default.conf

Are these kernel settings kept in different places in different distributions? If so, where should I edit kernel.sysrq to make the changes permanent in an Arch system?

3

See the description of sysctl --system:

Load settings from all system configuration files. Files are read from directories in the following list in given order from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.

/etc/sysctl.d/*.conf
/run/sysctl.d/*.conf
/usr/local/lib/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
/lib/sysctl.d/*.conf
/etc/sysctl.conf

So /usr/lib/sysctl.d/50-default.conf is appropriate for distribution-provided defaults, and your own overrides should go in /etc/sysctl.conf, or if you want to override the whole file, /etc/sysctl.d/50-default.conf.

As a general rule, you should never modify anything under /usr (except under /usr/local). Many programs with configuration shipped under /usr or /lib support overrides in /etc.

2

The file location can differ from distribution to distribution.

More important part of the question is where to make the changes. The files in /usr can be regarded "static" or "system-managed". Think of "do not edit". In this case, the file provides a default configuration.

You are meant to copy (relevant parts of) the file into the corresponding directory under /etc and do your changes there. /etc is for user configuration (or rather settings made by the administrator and applied "to all users").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.