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...

asked Aug 18, 2016 by anonymous

1 Answer

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.

answered Aug 18, 2016 by Eric Z Ma (44,280 points)

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

commented Aug 18, 2016 by Amir Afzaal (120 points)

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.

commented Aug 18, 2016 by Eric Z Ma (44,280 points)

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.

commented Aug 19, 2016 by Amir Afzaal (120 points)
edited Aug 19, 2016 by SA

These lines have no problem so far I can tell.

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

commented Aug 19, 2016 by Eric Z Ma (44,280 points)
# 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
commented Aug 19, 2016 by Amir Afzaal (120 points)
edited Aug 19, 2016 by SA

Your last 2 lines have problems:

pages
kernel.shmall = 4294967296

Maybe you want:

# pages
kernel.shmall = 4294967296
commented Aug 19, 2016 by Eric Z Ma (44,280 points)

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.

commented Aug 19, 2016 by Amir Afzaal (120 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...