When Apache does not start as intended, the first thing admins should do is check the error logs with cPanel. One of the error logs can be the ‘segmet: No space left on device’ error. This basically informs that the server is out of semaphores. To know the number of semaphores that are currently in use, login to the server as the root user and execute the following:
To fix this error, you need to clear all or most of the semaphores. For this, execute the below command:
If you’re a user of old Apache servers, the above code may not work. So you should go with the following code:
It should fix the error.
If you’re experiencing the segmet error again and again, you may decide to increase the semaphore limit on the server. For this purpose, open the configuration file at /etc/sysctl.conf and add the following lines:
# For increasing the semaphore limits & extend Apache’s uptime:
Later, users can load new settings into the kernel by using the following code:
So that’s how you fix the ‘semget: No space left on device’ error.
Code:
ipcs –s
Code:
for whatever in `ipcs -s | awk ‘{print $2}’`; do ipcrm -s $whatever; done
Code:
/sbin/service httpd stop
ipcs -s | grep nobody | gawk ‘{ print $2 }’ | xargs -n 1 ipcrm sem
/sbin/service httpd start
If you’re experiencing the segmet error again and again, you may decide to increase the semaphore limit on the server. For this purpose, open the configuration file at /etc/sysctl.conf and add the following lines:
# For increasing the semaphore limits & extend Apache’s uptime:
Code:
kernel.msgmni = 512
kernel.sem = 250 128000 32 512
Code:
sysctl -p