[NBLUG/talk] ipcs/ipcrm

Ross Thomas boscorama at fastmail.us
Mon Jun 20 17:55:05 PDT 2005


Hi Gandalf,

On Mon, 20 Jun 2005 17:34:54 -0700 (PDT), "Walter Hansen"
<gandalf at sonic.net> said:
> Did I post at an bad time or does no one realy have a clue on this?

Mebbe both.  I was hoping someone more experienced would
answer, but I guess they're all hiding.  ;-)

> > I've got a machine running perl scripts that comunicate with each other.
> > The thing is they do so via shared variables, and the shared variables
> > hang arround afterwards.

Can you show us an ipcs from when it is quiet so we can see what
is hanging around?  Is it just shared mem?  Or does it include sem's
and queues?

> > Script I found that doesn't work:
> > #! /bin/sh
> > for PID in `ps -ef | grep -v root | grep -v proccessname | grep -v userid
> > | grep " 1 " | awk '{print $2}' `
> > do
> > echo killing $PID$TEST
> > kill $PID
> > for QID in `ipcs -qp | grep -w $PID | awk '{print $2}'`
> > do
> > echo removing $QID$TEST
> > ipcrm -q $QID
> > done

OK.  There are some 'pseudo' vars in there.  Things like 'processname'
and 'userid' are not really meant to be there.  Also, I have no idea
what
the $TEST is for except to make things fail when set.

Not only that, the ipcrm is only dealing with queues.  No shared mem
or sem's.

The three types of IPC constructs have different reporting via ipcs
so once we know what is being 'orphaned' we can know how to
write the script to do the right thing.

HTH.

Ross.

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free




More information about the talk mailing list