manjaro / release-plan

Roadmap for our Manjaro install media releases
85 stars 7 forks source link

sysctl is broken #214

Closed hansw-nlo closed 2 years ago

hansw-nlo commented 2 years ago

Hi all, writing this here, imho a forum is not suited for handling issues.

Sysctl in Manjaro is broken. Manjaro points to the Arch manual and there it is stated one should create files in the /etc/sysctl.d/ directory. However, a sysctl -p nags that /etc/sysctl.conf can't be found.

cd /etc/sysctl.d/
vi 50-namespace.conf
sysctl -p

sysctl: cannot open "/etc/sysctl.conf": No such file or directory

The fix is to simply move all entries to /etc/sysctl.conf and then it works

fhdk commented 2 years ago

It is not broken - your command is using the wrong arguments.

Exerpt from sysctl -h

  -p, --load[=<file>]  read values from file
  -f                   alias of -p
      --system         read values from all system directories

When you use -p you are supposed to add a filename - if you don't sysctl.conf will be assumed and as it is not there the message is thrown

use --system instead or use the correct argument

 sysctl -p /etc/sysctl.d/50-namespace.conf
hansw-nlo commented 2 years ago

Using a filename is optional, see the man page.

Load  in  sysctl   settings   from   the   file   specified   or
              /etc/sysctl.conf  if none given.  Specifying - as filename means
              reading data from standard input

The --system gets it from other locations. Imho their should either be a /etc/sysctl.conf or the code should be adjusted to not nag anyone about it.

fhdk commented 2 years ago

If you want to use /etc/sysctl.conf that's fine but the behavior is not a bug - the message is purely informational.

sysctl load configurations found /etc/sysctl.d on boot and when you initiate a reload using

sysctl --system

If you want to reload a specific file - use

sysctl -p /path/to/config.conf