I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
I am running the latest updates on CentOS 6.3
Emmett
On 2 January 2013 17:54, Emmett Culley emmett@webengineer.com wrote:
I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
It depends on whether the changes you are making using sysctl are being
affected by other processes later on in the startup sequence
I have to run sysctl -p manually in order to stop kernel messages being printed to the console as even though i have them configured off in my sysctl this is overridden at some other point and i get to find out all about SoftMAC and its scanning ways
https://bugzilla.redhat.com/show_bug.cgi?id=760497
mike
On 2 January 2013 17:54, Emmett Culley emmett@webengineer.com wrote:
I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
It depends on whether the changes you are making using sysctl are being
affected by other processes later on in the startup sequence
I have to run sysctl -p manually in order to stop kernel messages being printed to the console as even though i have them configured off in my sysctl this is overridden at some other point and i get to find out all about SoftMAC and its scanning ways
Mike:
Just on a hunch, check your /etc/rsyslog.conf file and look for:
# Log all kernel messages to the console. # Logging much else clutters up the screen. kern.* /dev/console
If you see that, comment it out, reload rsyslog and that should take care of it.
You can also play with some rules in rsyslog that can redirect the kernel output to wherever you like...or even specific kernel output (iptables, etc.) to various logs or even /dev/null :-)
Mike:
Just on a hunch, check your /etc/rsyslog.conf file and look for:
# Log all kernel messages to the console. # Logging much else clutters up the screen. kern.* /dev/console
If you see that, comment it out, reload rsyslog and that should take care of it.
Hi Mike
yep What i did was set up a dedicated syslog server with a big /var and redirected everything below crit to that instead. Needed to run a lot of debug from a cisco router after experiencing an odd/intermittent pppoA problem so it made sense.
mike
On 01/08/2013 02:58 AM, Michael Simpson wrote:
On 2 January 2013 17:54, Emmett Culley emmett@webengineer.com wrote:
I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
It depends on whether the changes you are making using sysctl are being
affected by other processes later on in the startup sequence
I have to run sysctl -p manually in order to stop kernel messages being printed to the console as even though i have them configured off in my sysctl this is overridden at some other point and i get to find out all about SoftMAC and its scanning ways
https://bugzilla.redhat.com/show_bug.cgi?id=760497
mike
I ended up putting sysctl -p in to /etc/rc.local, which fixed the problem. I thought I'd read the rc.local is deprecated, so I resisted using it. Oh well...
Emmett
Am 08.01.2013 um 20:25 schrieb Emmett Culley:
On 01/08/2013 02:58 AM, Michael Simpson wrote:
On 2 January 2013 17:54, Emmett Culley emmett@webengineer.com wrote:
I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
It depends on whether the changes you are making using sysctl are being
affected by other processes later on in the startup sequence
I have to run sysctl -p manually in order to stop kernel messages being printed to the console as even though i have them configured off in my sysctl this is overridden at some other point and i get to find out all about SoftMAC and its scanning ways
https://bugzilla.redhat.com/show_bug.cgi?id=760497
mike
I ended up putting sysctl -p in to /etc/rc.local, which fixed the problem. I thought I'd read the rc.local is deprecated, so I resisted using it. Oh well...
for sysctl configs i suggest the /etc/sysctl.d directory (create it if ...)
for example:
$ cat /etc/sysctl.d/vpn.conf net.ipv4.ip_forward = 1
-- LF
On 01/08/2013 12:39 PM, Leon Fauster wrote:
Am 08.01.2013 um 20:25 schrieb Emmett Culley:
On 01/08/2013 02:58 AM, Michael Simpson wrote:
On 2 January 2013 17:54, Emmett Culley emmett@webengineer.com wrote:
I understand that the contents of /etc/sysctl.conf should be read and executed at system startup. However that never happens and I have to run sysctl -p after every reboot to get the settings I want.
This is happening on every CentOS machine and VM I have. I can see in the startup scripts that "sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1" is run at start up by the "apply_sysctl" function, yet the settings are never correct unless I run sysctl -p on the command line.
Anybody know why that would be?
It depends on whether the changes you are making using sysctl are being
affected by other processes later on in the startup sequence
I have to run sysctl -p manually in order to stop kernel messages being printed to the console as even though i have them configured off in my sysctl this is overridden at some other point and i get to find out all about SoftMAC and its scanning ways
https://bugzilla.redhat.com/show_bug.cgi?id=760497
mike
I ended up putting sysctl -p in to /etc/rc.local, which fixed the problem. I thought I'd read the rc.local is deprecated, so I resisted using it. Oh well...
for sysctl configs i suggest the /etc/sysctl.d directory (create it if ...)
for example:
$ cat /etc/sysctl.d/vpn.conf net.ipv4.ip_forward = 1
-- LF
There was no /etc/sysctl.d directory, so I created one and added a file with sysctl -p on the first line, still no change to my requested settings after a reboot. So I changed the file to look like:
#!/bin/bash sysctl -p
and made it executable (just in case :-) and of course that didn't work either.
I've noted that there was a bug reported for RHEL5 that stated this would be fixed in 6. I guess that didn't happen. And I am not even certain that it isn't working as expected.
In the mean time I will stick to using /etc/rc.local.
Emmett
Am 09.01.2013 um 17:13 schrieb Emmett Culley:
On 01/08/2013 12:39 PM, Leon Fauster wrote:
for sysctl configs i suggest the /etc/sysctl.d directory (create it if ...)
for example:
$ cat /etc/sysctl.d/vpn.conf net.ipv4.ip_forward = 1
There was no /etc/sysctl.d directory, so I created one and added a file with sysctl -p on the first line, still no change to my requested settings after a reboot. So I changed the file to look like:
#!/bin/bash sysctl -p
and made it executable (just in case :-) and of course that didn't work either.
I've noted that there was a bug reported for RHEL5 that stated this would be fixed in 6. I guess that didn't happen. And I am not even certain that it isn't working as expected.
In the mean time I will stick to using /etc/rc.local.
The files (/etc/sysctl.d/*.conf) must have the format of e.g.
net.ipv4.ip_forward = 1
like /etc/sysctl.conf
That files (/etc/sysctl.d/*.conf) are read by the start script rc.sysinit (function apply_sysctl) after /etc/sysctl.conf was read.
-- LF
On 01/09/2013 08:34 AM, Leon Fauster wrote:
Am 09.01.2013 um 17:13 schrieb Emmett Culley:
On 01/08/2013 12:39 PM, Leon Fauster wrote:
for sysctl configs i suggest the /etc/sysctl.d directory (create it if ...)
for example:
$ cat /etc/sysctl.d/vpn.conf net.ipv4.ip_forward = 1
There was no /etc/sysctl.d directory, so I created one and added a file with sysctl -p on the first line, still no change to my requested settings after a reboot. So I changed the file to look like:
#!/bin/bash sysctl -p
and made it executable (just in case :-) and of course that didn't work either.
I've noted that there was a bug reported for RHEL5 that stated this would be fixed in 6. I guess that didn't happen. And I am not even certain that it isn't working as expected.
In the mean time I will stick to using /etc/rc.local.
The files (/etc/sysctl.d/*.conf) must have the format of e.g.
net.ipv4.ip_forward = 1
like /etc/sysctl.conf
That files (/etc/sysctl.d/*.conf) are read by the start script rc.sysinit (function apply_sysctl) after /etc/sysctl.conf was read.
-- LF
Yes, that is what I tried first. I just made it executable after that failed as it was quicker to do that than to google or ask the list.
As for apply_sysctl... That calls sysctl -e -p /etc/sysctl.conf. At least that is what I would expect. However if it is getting called, the changes aren't sticking.
Emmett