Date: Fri, 16 Dec 2005 04:44:09 +1100 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: freebsd-stable@freebsd.org Subject: Re: shmget errors Message-ID: <20051215174409.GN77268@cirb503493.alcatel.com.au> In-Reply-To: <200512151422.jBFEM4Ei058512@lurza.secnetix.de> References: <20051215132556.GB74188@freenix.no> <200512151422.jBFEM4Ei058512@lurza.secnetix.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2005-Dec-15 15:22:04 +0100, Oliver Fromme wrote: >Also, the following shell snippet might be helpful: > >ipcs | awk '($1=="m"){print $2}' | xargs -n 1 -t ipcrm -m ipca -ma | awk '$9 == "0"{print $2}' | xargs -n 1 -t ipcrm -m has the advantage of only removing segments with no processes attached. >It removes _all_ shared memory segments. Be careful: >Don't do that while any programs are still running which >use SysV shared memory. As with deleting open files, the segment doesn't disappear immediately but only after the last process detaches (see IPC_RMID in shmctm(2)). > You can check that by looking at >the output of ``ipcs -p'': If the process IDs listed under >the CPID and LPID columns don't exist, chances are that the >memory segment isn't in use anymore. Looking at NATTACH in "ipcs -a" is a better approach. -- Peter Jeremy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051215174409.GN77268>