If you run into semaphore issues….

First, determine the number of semaphores in use.

ipcs | wc -l

Then determine the current settings in the kernel for the number of semaphores.

cat /proc/sys/kernel/sem

Look at the 4th field. It shows the maximum number of shared memory segments for the entire system. If your number of semaphores in use is higher than this number, you will need to increase it. You do this in increments of 128. For example, if your ipcs output is 267 and your kernel settings are '384 64000 64 256' then you have exceeded the number of available shared memory segments.

Add increments of 128 to each of the numbers to exceed what the system is currently using. In this case, you can just add 1×128 so your new values would be: '512 64128 192 384'.

Edit /etc/sysctl.conf and look for "kernel.sem=". Add your new values here, replacing what is here (or better yet, comment the line and add a new one with the new values).

Once you have added this, all you have to do (on a Redhat box) is to issue

sysctl -p

in order to use the new values.