Page 1 of 1

[SOLVED] after upgrade: /etc/sysctl.conf not read?

PostPosted: Mar 12th, '14, 11:16
by magfan
After upgrading mga3 -> mga4 I discovered that either the file "/etc/sysctl.conf" is not read any more or some values are overwritten after it has been read. I first became aware of this problem when the postgresql server did not start while booting:
Code: Select all
$ FATAL:  could not create shared memory segment: Invalid argument                                                                   
DETAIL:  Failed system call was shmget(key=5432001, size=41205760, 03600).                                                                                 
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 41205760 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.                                                                                                     
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.                                                                                                                       
        The PostgreSQL documentation contains more information about shared memory configuration.                                                         

The strange thing is that in "/etc/sysctl.conf" the kernel values are set as follows:
Code: Select all
kernel.shmmax=8589934592
kernel.shmall=2097152

But after booting kernel.shmmax has a wrong value:
Code: Select all
# cat /proc/sys/kernel/shmmax
33554432

How can I solve this problem?

Re: after upgrade: /etc/sysctl.conf not read?

PostPosted: Mar 12th, '14, 15:29
by ITA84
I think it's because of a new version of systemd, which uses /etc/sysctl.d instead.

https://www.archlinux.org/news/deprecat ... ysctlconf/

This is from Archlinux, but it should work in Mageia too: simply copy your sysctl.conf settings to a numbered file in /etc/sysctl.d (e.g 99-sysctl.conf), or to separate files.

Re: after upgrade: /etc/sysctl.conf not read?

PostPosted: Mar 12th, '14, 21:57
by doktor5000
This is not only the case since Mageia 4, check https://bugs.mageia.org/show_bug.cgi?id=12066

Re: after upgrade: /etc/sysctl.conf not read?

PostPosted: Mar 13th, '14, 13:10
by magfan
doktor5000 wrote:This is not only the case since Mageia 4, check https://bugs.mageia.org/show_bug.cgi?id=12066

Maybe I was simlpy lucky and I did not run into that problem before. A long time ago I changed /etc/sysctl.conf because postgresql did not start. After that I never had problems until I upgraded to mga4. That is why I thought it is an upgrade issue with mga4. But thanks to this hint it is working again:
ITA84 wrote:I think it's because of a new version of systemd, which uses /etc/sysctl.d instead.

https://www.archlinux.org/news/deprecat ... ysctlconf/

This is from Archlinux, but it should work in Mageia too: simply copy your sysctl.conf settings to a numbered file in /etc/sysctl.d (e.g 99-sysctl.conf), or to separate files.