Commit 7f0d7a1e authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add some force options to make sure I can get instances experiments

swapped out event when endrun fails for some reason.
parent 4528e30c
...@@ -43,12 +43,13 @@ sub usage() ...@@ -43,12 +43,13 @@ sub usage()
"<guid/vers> - GUID and version to swapin\n"); "<guid/vers> - GUID and version to swapin\n");
exit(-1); exit(-1);
} }
my $optlist = "qwx:p:E:a:r:e:dscft:"; my $optlist = "qwx:p:E:a:r:e:dscft:i";
my %options = (); my %options = ();
my $quiet = 0; my $quiet = 0;
my $waitmode = 0; my $waitmode = 0;
my $debug = 0; my $debug = 0;
my $foreground = 0; my $foreground = 0;
my $ignoreerrors = 0;
my $clean = 0; my $clean = 0;
my $paramfile; my $paramfile;
my %parameters = (); my %parameters = ();
...@@ -362,10 +363,12 @@ if (defined($instance->runidx())) { ...@@ -362,10 +363,12 @@ if (defined($instance->runidx())) {
# This runs loghole. # This runs loghole.
print "Asking loghole to sync the logfiles ... this will take a minute.\n"; print "Asking loghole to sync the logfiles ... this will take a minute.\n";
$instance->LogHole() == 0 $instance->LogHole() == 0
or $ignoreerrors
or fatal(-1, "Loghole failed"); or fatal(-1, "Loghole failed");
print "Dumping the instance database ... this will take a minute.\n"; print "Dumping the instance database ... this will take a minute.\n";
$instance->DumpDB() == 0 $instance->DumpDB() == 0
or $ignoreerrors
or fatal(-1, "Dump Database failed"); or fatal(-1, "Dump Database failed");
# #
...@@ -576,6 +579,9 @@ sub ParseArgs() ...@@ -576,6 +579,9 @@ sub ParseArgs()
if (defined($options{"c"})) { if (defined($options{"c"})) {
$clean = 1; $clean = 1;
} }
if (defined($options{"i"})) {
$ignoreerrors = 1;
}
if (defined($options{"t"})) { if (defined($options{"t"})) {
$ctoken = $options{"t"}; $ctoken = $options{"t"};
...@@ -691,6 +697,7 @@ sub SignalProgAgents($) ...@@ -691,6 +697,7 @@ sub SignalProgAgents($)
} }
system("$tevc -w -t 60 -e $pid/$eid now $agent $action") == 0 system("$tevc -w -t 60 -e $pid/$eid now $agent $action") == 0
or $ignoreerrors
or fatal(-1, "Could not send event notification!"); or fatal(-1, "Could not send event notification!");
} }
......
...@@ -34,9 +34,10 @@ sub usage() ...@@ -34,9 +34,10 @@ sub usage()
"<guid/vers> - GUID and version to swapin\n"); "<guid/vers> - GUID and version to swapin\n");
exit(-1); exit(-1);
} }
my $optlist = "qwaie:b"; my $optlist = "qwaie:bf";
my %options = (); my %options = ();
my $quiet = 0; my $quiet = 0;
my $force = 0;
my $waitmode = 0; my $waitmode = 0;
my $batchmode = 0; # Called from the batch daemon. my $batchmode = 0; # Called from the batch daemon.
my $eid; my $eid;
...@@ -258,7 +259,9 @@ if ($waitmode) { ...@@ -258,7 +259,9 @@ if ($waitmode) {
# #
# Stop the current run. # Stop the current run.
# #
system("$endrun -a stop -f -e $eid $guid/$version") == 0 my $opt = ($force ? "-i" : "");
system("$endrun $opt -a stop -f -e $eid $guid/$version") == 0
or fatal(-1, "Could not stop the current run!"); or fatal(-1, "Could not stop the current run!");
# This sets the stop time. # This sets the stop time.
...@@ -340,6 +343,9 @@ sub ParseArgs() ...@@ -340,6 +343,9 @@ sub ParseArgs()
if (defined($options{"b"})) { if (defined($options{"b"})) {
$batchmode = 1; $batchmode = 1;
} }
if (defined($options{"f"})) {
$force = 1;
}
} }
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment