onehealth-cookbooks/sysctl — pull request #9 by warrenv (2013-07-26 13:19:52+00:00)
Title: make changes available immediately

This fixes a problem when bumping SHMMAX and installing postgres with max_connections set to 512 during an initial chef-client run. When chef tries to restart postgres it doesn't recognize the new SHMMAX:

STDOUT: * Restarting PostgreSQL 8.4 database server
* The PostgreSQL server failed to start. Please check the log output:
2013-06-11 19:24:38 UTC FATAL: could not create shared memory segment: Invalid argument
2013-06-11 19:24:38 UTC DETAIL: Failed system call was shmget(key=5432001, size=40615936, 03600).
2013-06-11 19:24:38 UTC 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 40615936 bytes), reduce PostgreSQL's shared_buffers parameter (currently 3072) and/or its max_co
nnections parameter (currently 515).
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.
...fail!
STDERR:
---- End output of /etc/init.d/postgresql restart ----
Ran /etc/init.d/postgresql restart returned 1