Postgres installation fails on Redhat 7 with shared memory error when run as non root user but works when run as root

Document ID : KB000008162
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Running the Enterprise Manager installer to install postgres on Linux as a non root user does not intelligently check the shared memory configuration.

The current setting can be checked as follows

# cat /proc/sys/kernel/shmmax
18446744073692774399

or by

$ sbin/sysctl -e kernel.shmmax
kernel.shmmax = 18446744073692774399


The required minimum value for the Postgres install is 6693928832.

if the install is attempted as a non root user with the default value as defined above i.e. 18446744073692774399, the install will fail with the following message

Please have the sysadmin increase shared memory by adding the line
'kernel.shmmax=6693928832' to /etc/sysctl.conf.

 

Environment:
Redhat Linux 7.x
Cause:

The APM installer does not intelligently check the current shared memory segment size - it seems to ignore the value from the command /sbin/sysctl -e kernel.shmmax and then simply rely on finding a value in the /etc/sysctl.conf file - but it only behaves this way when run as non - root.

Resolution:

Edit the file /etc/sysctl.conf and set: 

kernel.shmmax = 6693928832  (or higher)