You are not logged in.
I've run into this when trying to increase the inotify watches limit following these instructions.
Since upgrading systemd to version 207 sysctl.conf no longer exists, so instead I've put the following line in /etc/sysctl.d/99-sysctl.conf:
fs.inotify.max_user_watches = 524288
But when running "sudo sysctl -p" I get the following message:
$ sudo sysctl -p
sysctl: cannot open "/etc/sysctl.conf": No such file or directory
This is because according to the man page for sysctl:
-p[FILE], --load[=FILE]
Load in sysctl settings from the file specified or
/etc/sysctl.conf if none given.
So, "sysctl -p" by default looks for the sysctl.conf file, which no longer exists in up-to-date arch boxes.
The solution of course is simply running:
sudo sysctl -p /etc/sysctl.d/99-sysctl.conf
But my question is, shouldn't "sysctl -p" look for settings files in /etc/sysctl.d and run all of them by default, instead of looking for a file which does not exist? (and that, even if it exists, will not be run on startup). From my understanding, "sysctl -p" is supposed to apply by default the same settings that will be applied on the next reboot.
Offline
You can preview current sysctl settings through /proc, for example if you want to know the setting you shown:
cat /proc/sys/fs/inotify/max_user_watches
As for sysctl program, you should probably file a bug to procps-ng devs.
EDIT: I found --system option in sysctl man, does that do the trick?
Last edited by kaszak696 (2013-09-19 10:36:11)
'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard
Offline
@kaszak696: no, "sysctl --system" also gives an error message:
$ sudo sysctl --system
[sudo] password for amatriain:
* Applying /usr/lib/sysctl.d/50-coredump.conf ...
kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e
* Applying /usr/lib/sysctl.d/50-default.conf ...
kernel.sysrq = 16
kernel.core_uses_pid = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/99-sysctl.conf ...
fs.inotify.max_user_watches = 524288
* Applying /etc/sysctl.conf ...
sysctl: cannot open "/etc/sysctl.conf": No such file or directory
Thanks for finding another example of sysctl wrongly assuming that sysctl.conf exists
I'll report the bug to upstream.
Offline
I don't think it's an error, and I don't think upstream are likely to change it (systemd isn't the only init system out there after all). It's possible that core/procps-ng will eventually drop the sysctl binary, as systemd is using /usr/lib/systemd/systemd-sysctl, not procps-ng's /usr/bin/sysctl.
I've not seen any mention of this on the mailing lists though, these are just my own thoughts. systemd-sysctl isn't a drop-in replacement, so /usr/bin/sysctl may be kept around for compatibility reasons.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Well, it seems that /usr/lib/systemd/systemd-sysctl, if it is being called, isn't reading /etc/sysctl.d/99-sysctl.conf. I had re-enabled the sysrq there (setting kernel.sysrq=1) and it still was the 16 default. And I have systemd 208-1 installed, this supposedly was fixed in 207.
Last edited by jbernardo (2013-10-10 15:32:48)
Offline
Well, it seems that /usr/lib/systemd/systemd-sysctl, if it is being called, isn't reading /etc/sysctl.d/99-sysctl.conf. I had re-enabled the sysrq there (setting kernel.sysrq=1) and it still was the stupid 16 default.
What's the output of
sudo sysctl -a | grep kernel.sysrq
Offline
Also, what is the output of:
# /usr/lib/systemd/systemd-sysctl
and
# systemctl status systemd-sysctl.service
and
$ cat /etc/sysctl.d/99-sysctl.conf
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
jbernardo wrote:Well, it seems that /usr/lib/systemd/systemd-sysctl, if it is being called, isn't reading /etc/sysctl.d/99-sysctl.conf. I had re-enabled the sysrq there (setting kernel.sysrq=1) and it still was the stupid 16 default.
What's the output of
sudo sysctl -a | grep kernel.sysrq
Never mind, stupid mistake on my part, I had /etc/sysctl.d/99sysctlconf instead of /etc/sysctl.d/99-sysctl.conf, probably the lack of .conf extension was breaking things. I renamed it and now it works. Sorry.
Last edited by jbernardo (2013-10-13 07:20:55)
Offline