Sysctl has to be run manually? (Solved) thanks to ClaW

Archived topics about LMDE 1 and LMDE 2
Locked
gorade
Level 2
Level 2
Posts: 77
Joined: Sat Feb 07, 2009 3:53 pm

Sysctl has to be run manually? (Solved) thanks to ClaW

Post by gorade »

Wanted to turn of answering PING permanently so I added the line

Code: Select all

net.ipv4.icmp_echo_ignore_all = 1
to /etc/sysctl.conf.
However that didn't help. After reboot PING were still answered until I manually ran sysctl -p

Code: Select all

gorade@hippocampus:~$ sudo sysctl -p
[sudo] password for gorade: 
vm.swappiness = 10
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_echo_ignore_all = 1
gorade@hippocampus:~$
Thus it seems like sysctl isn't run automatically. What should I do?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
CiaW

Re: Sysctl has to be run manually?

Post by CiaW »

Edit: My original reply is below, but reading further in the 2nd link I provided, it appears there's an exception because Debian doesn't use /etc/rc.local ? (But the file is there, not sure why?) So section 11.6 on this link discusses startup scripts in Debian: http://www.debian.org/doc/FAQ/ch-customizing.en.html

You could add the command to /etc/rc.local ? I had to do that with a modprobe command at one time. The instructions say to add it before the exit 0 line. Here's a short thread I found: http://ubuntuforums.org/showthread.php?t=563519 or a little more detailed info here: http://www.linux.com/news/enterprise/sy ... cd-scripts

HTH.
gorade
Level 2
Level 2
Posts: 77
Joined: Sat Feb 07, 2009 3:53 pm

Re: Sysctl has to be run manually?

Post by gorade »

Ha! That worked. I edited /etc/rc.local and added the command:

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
sysctl -p # run sysctl at start up

exit 0
Now no PING is answered. Thank you ClaW!
Locked

Return to “LMDE Archive”