If you changed it by echoing a new value into /proc/sys/kernel, then that value will go away with your next reboot.
Did you get an error when you did the 'sysctl -p'? Did you validate that the new value was properly set (sysctl -a | grep shmmax)?
Do you have more than one 'kernel.shmmax' key/value pair coded in /etc/sysctl.conf? (If there are a lot of 'sysctl.conf' "overrides" then you might have missed that it is specified twice.)
'sysctl -p' takes effect immediately, so if it's not either of these, then it may be a bug. But I would check it after your next reboot to see what the value is. I suspect it is back to it's original value.
A bad key/value pair would give you this.
Code:
[root@athlonz ~]# echo "shmmax=536870912" >> /etc/sysctl.conf
[root@athlonz ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
error: "shmmax" is an unknown key
Remove the bad entry.
Code:
[root@athlonz ~]# vi /etc/sysctl.conf
With the properly formed entry it is ok on my system.
Code:
[root@athlonz ~]# echo "kernel.shmmax=536870912" >> /etc/sysctl.conf
[root@athlonz ~]# tail -n2 /etc/sysctl.conf
kernel.core_uses_pid = 1
kernel.shmmax=536870912
[root@athlonz ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.shmmax = 536870912
[root@athlonz ~]# sysctl -a | grep shmmax
kernel.shmmax = 536870912
But with it specified twice, the first one is lost.
Code:
[root@athlonz ~]# echo "kernel.shmmax=33554432" >> /etc/sysctl.conf
[root@athlonz ~]# tail -n3 /etc/sysctl.conf
kernel.core_uses_pid = 1
kernel.shmmax=536870912
kernel.shmmax=33554432
[root@athlonz ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.shmmax = 536870912
kernel.shmmax = 33554432
[root@athlonz ~]# sysctl -a | grep shmmax
kernel.shmmax = 33554432