Why I got message “invalid syntax, continuing…” when I execute “sysctl”?

When I tried to apply new configuration in /etc/sysctl.conf, I got following message.

warning: /etc/sysctl.conf(44): invalid syntax, continuing…

Sounds like your changed /etc/sysctl.conf has problem.

You may post the content of your /etc/sysctl.conf here to let other have a check.


net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.all.rp_filter = 1
warning: /etc/sysctl.conf(44): invalid syntax, continuing…
kernel.shmall = 4294967296













Hi Amir, is this the content of cat /etc/sysctl.conf? If so, this line

warning: /etc/sysctl.conf(44): invalid syntax, continuing...

should not be there.


Hello Eric, Thanks for your response..!
In fact, I added following lines in /etc/sysctl.conf

# Do not accept ICMP redirects (prevent MITM attacks)
  net.ipv4.conf.all.accept_redirects = 0
  net.ipv6.conf.all.accept_redirects = 0 

#Enable IP Spoofing Protection
  net.ipv4.conf.all.rp_filter = 1 

Please, check and tell me what could be syntax error in these lines. Looking Forward your prompt and product response.


These lines have no problem so far I can tell.

You may post the whole content of your /etc/sysctl.conf to be checked.


# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in 
# Do not accept ICMP redirects (prevent MITM attacks)
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0 

#Enable IP Spoofing Protection
net.ipv4.conf.all.rp_filter = 1 

pages
kernel.shmall = 4294967296

Your last 2 lines have problems:

pages
kernel.shmall = 4294967296

Maybe you want:

# pages
kernel.shmall = 4294967296

Thanks Eric..! You pointed out and I found my mistake. Problem is solved. Now I have another question, how can I install glibc, glibc-common and GD libraries if I already have Apache and PHP running on my centOS 6.7 ? In fact,these libraries are prerequisites for Nagios installation. Waiting for your response.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *