Other file than /etc/rc.local that triggered when boot?

i have a cloudflared installed in my router and i want to set sysctl -w net.core.rmem_max=2500000, however i dont want to touch /etc/rc.local, where i can put this command other than in there ? perhaps in a file that executed earlier than in /etc/rc.local ?

There is the /etc/sysctl.d directory which will be processed by the sysctl service during startup. Or /etc/sysctl.conf.

6 Likes

sysctl runs at 11 during boot (and rc.local at 95), so as Dave indicates, you could do this to get your setting much earlier in the boot cycle:

$ echo 'net.core.rmem_max=2500000' > /etc/sysctl.d/99-cloudflared.conf
$ echo '/etc/sysctl.d/99-cloudflared.conf' >> /etc/sysupgrade.conf

Of course adjusting the 99 to suit your use case (look at the contents of the other files in /etc/sysctl.d/).

First line does what you expect, second line makes sure that sysupgrade, asu and auc preserve the file over upgrades.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.