Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how to modify /etc/sysctl.conf on boot

Featured Replies

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.

You can do it they way I do :D

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

 

  • Author

Do I need to include the entire contents of the old sysctl.conf file?

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 by ken-ji

  • Author

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 by wgstarks

  • Author
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

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.

 

  • Author

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?

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 by pwm

  • Author

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.

  • Author

Error in system log-

/var/tmp/go: line 11 : bin/sysctl: No such file or directory

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

Yes, was me fouling up my post. /sbin/ is intended for statically linked applications run on boot or when system is updating itself.

  • Author
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 :D

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.