Revision 10724,
596 bytes
checked in by ghudson, 27 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r10723,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | # $RCSfile: shmkill,v $$Revision: 1.1.1.2 $$Date: 1997-11-13 01:47:45 $ |
---|
4 | |
---|
5 | # A script to call from crontab periodically when people are leaving shared |
---|
6 | # memory sitting around unattached. |
---|
7 | |
---|
8 | open(ipcs,'ipcs -m -o|') || die "Can't run ipcs: $!"; |
---|
9 | |
---|
10 | while (<ipcs>) { |
---|
11 | $tmp = index($_,'NATTCH'); |
---|
12 | $pos = $tmp if $tmp >= 0; |
---|
13 | if (/^m/) { |
---|
14 | ($m,$id,$key,$mode,$owner,$group,$attach) = split; |
---|
15 | if ($attach != substr($_,$pos,6)) { |
---|
16 | die "Different ipcs format--can't parse!\n"; |
---|
17 | } |
---|
18 | if ($attach == 0) { |
---|
19 | push(@goners,'-m',$id); |
---|
20 | } |
---|
21 | } |
---|
22 | } |
---|
23 | |
---|
24 | exec 'ipcrm', @goners if $#goners >= 0; |
---|
Note: See
TracBrowser
for help on using the repository browser.