[NBLUG/talk] ipcs/ipcrm

Walter Hansen gandalf at sonic.net
Mon Jun 20 17:34:54 PDT 2005


Did I post at an bad time or does no one realy have a clue on this?

> 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. I can manually clean them up with ipcrm, but was
> disapointed that there wasn't a command for ipcrm that kills all non
> attached variables/sessions. I found a script that says it does that, but
> it dies on my machine and it's been years since I've programmed in sh.
> Anybody have any experience with this?
>
> Yes, I tried google.
> Yes, it's probably bad programming that they are left open but there are
> 70 scripts running and it's hard to determine which is the last one out.
>
> 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
>
>
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk
>
>





More information about the talk mailing list