LinuxHelps.com

A blog for Linux Lovers.

Posted by sibu on March 3, 2009

Semaphore

Semaphore

When you stop all service, the semaphore and shared memory segments have to be removed. If not, you will be able to them using ‘ipcs’ command.

We can remove the segment ID using ‘ipcrm’ command.

#ipcs -a

#ipcrm -s < sem id>

To increase the semaphore values.

# /sbin/sysctl -a | grep sem => To display the Sem values.

# /sbin/sysctl -w kernel.sem=250

Add new value in /etc/sysctl.conf file inorder for the change to persist across system reboots.

# sysctl -f => to save values

You should periodically clean up the shared memory you have allocated using the command ipcrm. A fast way to remove every bit of shared memory you have priviledges for is

ipcs -m | awk ‘{print $2}’ | xargs -n1 ipcrm -m

OR

for i in `ipcs -s | grep nobody | awk '{print $2}'`; do ipcrm -s $i; done


Add A Comment

Powered By Wordpress - Theme Provided By Wordpress Themes - Auto Loan Credit