Last change
on this file since 27560 was 27004, checked in by jmt12, 11 years ago |
A script to stop (using kill) a runaway import process and any related TDB processes. Intended to be run via 'rocks host run' to stop runaway imports on the cluster
|
-
Property svn:executable
set to
*
-
Property svn:mime-type
set to
application/x-perl
|
File size:
781 bytes
|
Rev | Line | |
---|
| 1 | #!/usr/bin/perl
|
---|
| 2 |
|
---|
| 3 | use strict;
|
---|
| 4 | use warnings;
|
---|
| 5 |
|
---|
| 6 | open(FIN, 'ps ax -o pid,command |') or die($!);
|
---|
| 7 | my $line = '';
|
---|
| 8 | while (($line = <FIN>))
|
---|
| 9 | {
|
---|
| 10 | # Kill import processes
|
---|
| 11 | if ($line =~ /^\s*(\d+)\s+.*import\.pl/)
|
---|
| 12 | {
|
---|
| 13 | my $pid = $1;
|
---|
| 14 | print STDERR "Killing process: $line";
|
---|
| 15 | my $cmd = 'kill -KILL ' . $pid;
|
---|
| 16 | `$cmd`;
|
---|
| 17 | }
|
---|
| 18 | # Kill orphaned TDBCLI harnesses (?)
|
---|
| 19 | elsif ($line =~ /^\s*(\d+)\s+.*(tdbcli|tdb2txt|txt2tdb)/)
|
---|
| 20 | {
|
---|
| 21 | my $pid = $1;
|
---|
| 22 | print STDERR "Killing process: $line";
|
---|
| 23 | my $cmd = 'kill -KILL ' . $pid;
|
---|
| 24 | `$cmd`;
|
---|
| 25 | }
|
---|
| 26 | # Video processing - expensive
|
---|
| 27 | elsif ($line =~ /^\s*(\d+)\s+.*(HandbrakeCLI|hive2_ffmpegsvn)/)
|
---|
| 28 | {
|
---|
| 29 | my $pid = $1;
|
---|
| 30 | print STDERR "Killing video processing: $line";
|
---|
| 31 | my $cmd = 'kill -KILL ' . $pid;
|
---|
| 32 | `$cmd`;
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | close(FIN);
|
---|
| 36 |
|
---|
| 37 | exit;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.