I want to change two values using sysctl. One is the sysctl vm.swappiness=10 and the other, sysctl kernel.sysrq=1. However, when I run sysctl -p, it tells me sysctl: cannot open "/etc/sysctl.conf": No such file or directory, but sysctl -a returns this.
So, I want to ask where is my system storing sysctl config?
Asked
Active
Viewed 9,818 times
5
Akshat Vats
- 439
- 2
- 8
- 21
1 Answers
8
The configuration has long moved to /etc/sysctl.d/*
You can create individual files, e.g.
cat /etc/sysctl.d/swappiness.conf
vm.swappiness=10
As for the sysctl -a output - you're seeing the current kernel values.
Stephen Kitt
- 411,918
- 54
- 1,065
- 1,164
Artem S. Tashkinov
- 26,392
- 4
- 33
- 64
-
2And ```sysctl -p /etc/sysctl.d/swappiness.conf```? Will this make it permanent? – Akshat Vats Jun 25 '20 at 14:08
-
2This command will activate the setting for the current session, and on reboot Arch Linux boot scripts will do that automatically, so, yes, it will make it permanent. – Artem S. Tashkinov Jun 25 '20 at 14:17