]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Cleanup remaining semaphores after EB. Sergey.
authorhadaq <hadaq>
Mon, 29 Nov 2010 13:55:30 +0000 (13:55 +0000)
committerhadaq <hadaq>
Mon, 29 Nov 2010 13:55:30 +0000 (13:55 +0000)
disks/ipcrm.pl [new file with mode: 0755]

diff --git a/disks/ipcrm.pl b/disks/ipcrm.pl
new file mode 100755 (executable)
index 0000000..9eed181
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+use English;
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+
+my @sem_list = `ipcs -s`;
+my @semid_list = ();
+
+foreach my $line (@sem_list){
+    if( $line =~ /\w+\s+(\d+)\s+\w+\s+\d+\s+\d+/){
+       my $semid = $1; 
+       push(@semid_list, $semid);
+    }
+}
+
+foreach my $semid (@semid_list){
+    my $cmd = "ipcrm -s " . $semid;
+    #print "exec: $cmd\n";
+    system("$cmd");
+}
+