/usr/share/doc/libhtml-template-perl/examples/clean_shm.pl is in libhtml-template-perl 2.10-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/usr/bin/env perl
use strict;
use warnings;
# this script deletes all shared memory segments accessible by the
# running user. Probably only works on Linux systems.
open(IPCS, 'ipcs |') or die "Probs opening icps : $!";
my $mode = 0;
while (<IPCS>) {
if (/(Shared)|(Semaphore)|(Message)/) {
$mode++;
next;
}
next unless /^0x[0-9a-f]+\s(\d+)\s.*$/;
system("ipcrm shm $1") if ($mode == 1);
system("ipcrm sem $1") if ($mode == 2);
system("ipcrm msg $1") if ($mode == 3);
}
|