where is the sysctl erorr logged?

General support questions
Post Reply
billchen8888
Posts: 2
Joined: 2020/06/23 18:08:09

where is the sysctl erorr logged?

Post by billchen8888 » 2020/06/23 18:23:27

I happened to notice that certain modules need to be loaded before certain kernel parameter is set. For example:

net.bridge.bridge-nf-call-iptables=1

this would need the module br_netfilter loaded before I can run the following command:

sysctl net.bridge.bridge-nf-call-iptables=1

Or sysctl command will complain:
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory

I created a file under /etc/sysctl.d/cust.conf, and reboot the server. I don't see the parameter is set. I know that is because I forgot to load the module. As I have many other parameters to be set, does the boot process write any log entry for this sort error (trying to set a parameter before the related module is loaded)?

I am running centos 7.8.2003 on AWS. I search the system log but didn't find any error message.

Any help is appreciated.

billchen8888
Posts: 2
Joined: 2020/06/23 18:08:09

Re: where is the sysctl erorr logged?

Post by billchen8888 » 2020/06/24 15:14:15

Since no one replied the thread yet, I add some more info here regarding the issue -

When are the /etc/sysctl.conf or /etc/sysctl.d/*.conf files read and applied?

I do see centos has a service "systemd-sysctl.service", which calls /usr/lib/systemd/systemd-sysctl

interesting enough, if I manually run

sysctl -p /etc/sysctl.d/cust.conf

the system complains:
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory

That is because I didn't load the br_netfilter module.

systemctl start systemd-sysctl.service
or /usr/lib/systemd/systemd-sysctl will not give any error.

Anyone know why we see this different behavior?

Post Reply

Return to “CentOS 7 - General Support”