wgstarks Posted November 20, 2017 Share Posted November 20, 2017 I'm trying to make modifications to sysctl.conf that will persist. I modified my go file but that isn't working. Full details described here. If anybody has any ideas I'd appreciate them. Quote Link to comment
ken-ji Posted November 20, 2017 Share Posted November 20, 2017 You can do it they way I do Place the new lines in a new config file somewhere in the usb, then modify the go file to execute /sbin/sysctl -p /boot/config/sysctl.conf 1 Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 Do I need to include the entire contents of the old sysctl.conf file? Quote Link to comment
ken-ji Posted November 20, 2017 Share Posted November 20, 2017 (edited) No need, the command just tells sysctl to modify the settings from your new config file, while the normal bootup scripts would have already used the standard config file to set up much earlier on in the boot up process. you could actually just invoke sysctl -w setting=value multiple times in the go file, but this way there will be just one other file to maintain for tweaks later on Edited November 20, 2017 by ken-ji Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 (edited) To be clear, the changes are being written to etc/sysctl.conf but aren’t being implemented. net.core.somaxconn = 128 This should be 2048. Edited November 20, 2017 by wgstarks Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 6 minutes ago, ken-ji said: No need, the command just tells sysctl to modify the settings from your new config file, while the normal bootup scripts would have already used the standard config file to set up much earlier on in the boot up process. you could actually just invoke sysctl -a setting=value multiple times in the go file, but this way there will be just one other file to maintain for tweaks later on I’ll give that a try. Thanks Quote Link to comment
ken-ji Posted November 20, 2017 Share Posted November 20, 2017 6 minutes ago, wgstarks said: To be clear, the changes are being written to etc/sysctl.conf but aren’t being implemented. net.core.somaxconn = 128 This should be 2048. Well /etc/systcl.conf is just a config file. Changing the contents won't do anything unless sysctl is called again referencing the the conf file But, the sysctl call that does that happens so much earlier in the boot process, so modifying sysctl.conf doesn't help at all. Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 I'm afraid it didn't work. go file- #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & /boot/cache_dirs -w beep -l 300 -f 220.00 -n -l 300 -f 293.66 -D 100 -n -l 150 -f 220.00 -n -l 150 -f 293.66 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 500 -f 293.66 -D 100 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 523.25 -D 100 -n -l 500 -f 261.63 -D 100 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 261.63 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 300 -n -l 300 -f 261.63 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 261.63 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 523.25 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 300 -f 523.25 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 150 -f 523.25 -D 100 -n -l 500 -f 659.26 -D 100 -n -l 500 -f 329.63 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 329.63 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 554.00 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 300 -f 223.00 -D 100 -n -l 750 -f 293.66 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 300 -f 223.00 -D 100 -n -l 750 -f 311.00 -D 100 -n -l 300 -f 293.66 -D 100 -n -l 150 -f 220.00 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 150 -f 233.00 -D 100 -n -l 500 -f 293.66 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 150 -f 233.00 -D 100 -n -l 500 -f 329.63 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 150 -f 370.00 -D 100 -n -l 500 -f 440.00 -D 100 # force iptable mangle module to load (required for *vpn dockers) /sbin/modprobe iptable_mangle # Enlarge the LOG partition mount -o remount,size=384m /var/log #syn flooding changes /sbin/sysctl -p /boot/scripts/sysctl.conf /boot/scripts/sysctl.conf- #!/bin/bash #syn flooding changes echo "net.core.somaxconn = 2048" >> /etc/sysctl.conf echo "net.ipv4.tcp_max_syn_backlog = 1024" >> /etc/sysctl.conf When I check the values they are still default. What did I get wrong? Quote Link to comment
pwm Posted November 20, 2017 Share Posted November 20, 2017 (edited) You are mixing between a script file that patches another file compared to having a configuration file that is used as input to /sbin/sysctl Your /boot/scripts/sysctl.conf is written as a shell-script intended to be run directly - not used as parameter to /sbin/sysctl Problem is that it will then patch a configuration file that the system has already processed - so patching it doesn't help you. To follow up to the suggestions you got earlier: /sbin/sysctl -p /boot/config/sysctl.conf Create a file /boot/config/sysctl.conf Make the contents of the file specify parameters in the format expected by /sbin/sysctl, i.e. net.core.somaxconn = 2048 net.ipv4.tcp_max_syn_backlog = 1024 Then modify the go file to call /sbin/sysctl with the above file as parameter /sbin/sysctl -p /boot/config/sysctl.conf The sysctl binary will take care of reading each rule and copy the numbers to the proper locations in the proc file system. Edited November 20, 2017 by pwm 1 Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 I'm sure this is my fault but still didn't work. go file- #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & /boot/cache_dirs -w beep -l 300 -f 220.00 -n -l 300 -f 293.66 -D 100 -n -l 150 -f 220.00 -n -l 150 -f 293.66 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 500 -f 293.66 -D 100 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 523.25 -D 100 -n -l 500 -f 261.63 -D 100 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 261.63 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 300 -n -l 300 -f 261.63 -n -l 300 -f 349.23 -D 100 -n -l 150 -f 261.63 -n -l 150 -f 349.23 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 349.23 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 523.25 -D 100 -n -l 500 -f 440.00 -D 100 -n -l 300 -f 523.25 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 150 -f 523.25 -D 100 -n -l 500 -f 659.26 -D 100 -n -l 500 -f 329.63 -D 100 -n -l 300 -f 440.00 -D 100 -n -l 150 -f 329.63 -D 100 -n -l 150 -f 440.00 -D 100 -n -l 500 -f 554.00 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 300 -f 223.00 -D 100 -n -l 750 -f 293.66 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 300 -f 223.00 -D 100 -n -l 750 -f 311.00 -D 100 -n -l 300 -f 293.66 -D 100 -n -l 150 -f 220.00 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 500 -f 349.23 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 150 -f 233.00 -D 100 -n -l 500 -f 293.66 -D 300 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 233.00 -D 100 -n -l 150 -f 196.00 -D 100 -n -l 150 -f 233.00 -D 100 -n -l 500 -f 329.63 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 300 -f 220.00 -D 100 -n -l 150 -f 293.66 -D 100 -n -l 150 -f 370.00 -D 100 -n -l 500 -f 440.00 -D 100 # force iptable mangle module to load (required for *vpn dockers) /sbin/modprobe iptable_mangle # Enlarge the LOG partition mount -o remount,size=384m /var/log #syn flooding changes /bin/sysctl -p /boot/scripts/sysctl.conf /boot/scipts/sysctl.conf- net.core.somaxconn = 2048 net.ipv4.tcp_max_syn_backlog = 1024 All values still at default after reboot. Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 Error in system log- /var/tmp/go: line 11 : bin/sysctl: No such file or directory Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 5 minutes ago, wgstarks said: Error in system log- /var/tmp/go: line 11 : bin/sysctl: No such file or directory The error gave it away. Changed the go file to sbin rather than bin and it worked. HURRAY @pwm @ken-ji Thanks for your help. Quote Link to comment
pwm Posted November 20, 2017 Share Posted November 20, 2017 Yes, was me fouling up my post. /sbin/ is intended for statically linked applications run on boot or when system is updating itself. Quote Link to comment
wgstarks Posted November 20, 2017 Author Share Posted November 20, 2017 1 minute ago, pwm said: Yes, was me fouling up my post. /sbin/ is intended for statically linked applications run on boot or when system is updating itself. No matter now. Just glad to get it to work and couldn't have done it without help. OBVIOUSLY 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.