Commit a74018b5 authored by Russ Fish's avatar Russ Fish

Report the current state when complaining that an experiment isn't active.

parent bb5d74fd
...@@ -150,7 +150,7 @@ if ($expstate ne EXPTSTATE_ACTIVE && ...@@ -150,7 +150,7 @@ if ($expstate ne EXPTSTATE_ACTIVE &&
$expstate ne EXPTSTATE_ACTIVATING && $expstate ne EXPTSTATE_ACTIVATING &&
$expstate ne EXPTSTATE_MODIFY_RESWAP && $expstate ne EXPTSTATE_MODIFY_RESWAP &&
$expstate ne EXPTSTATE_SWAPPING) { $expstate ne EXPTSTATE_SWAPPING) {
tbdie("$experiment must be active (or swapping)!"); tbdie("$experiment must be active (or swapping), not $expstate!");
} }
# #
......
...@@ -117,7 +117,7 @@ if (! defined($experiment)) { ...@@ -117,7 +117,7 @@ if (! defined($experiment)) {
# Check state. Only ACTIVE experiments. # Check state. Only ACTIVE experiments.
# #
if ($experiment->state() ne EXPTSTATE_ACTIVE) { if ($experiment->state() ne EXPTSTATE_ACTIVE) {
print STDERR "Experiment $pid/$eid is not ACTIVE!\n"; print STDERR "Experiment $pid/$eid is in state $estate, not ACTIVE!\n";
# For web page. # For web page.
exit(1); exit(1);
} }
......
...@@ -61,10 +61,12 @@ function CHECKPAGEARGS() { ...@@ -61,10 +61,12 @@ function CHECKPAGEARGS() {
USERERROR("You do not have permission to start/stop linktest ". USERERROR("You do not have permission to start/stop linktest ".
"on $pid/$eid!", 1); "on $pid/$eid!", 1);
} }
if ($experiment->state() != $TB_EXPTSTATE_ACTIVE && $expstate = $experiment->state();
$experiment->state() != $TB_EXPTSTATE_ACTIVATING && if ($expstate != $TB_EXPTSTATE_ACTIVE &&
$experiment->state() != $TB_EXPTSTATE_MODIFY_RESWAP) { $expstate != $TB_EXPTSTATE_ACTIVATING &&
USERERROR("Experiment $eid must be active to start/stop linktest!", 1); $expstate != $TB_EXPTSTATE_MODIFY_RESWAP) {
USERERROR("Experiment $eid must be active to start/stop linktest," .
" not $expstate!", 1);
} }
$pid = $experiment->pid(); $pid = $experiment->pid();
$eid = $experiment->eid(); $eid = $experiment->eid();
......
...@@ -80,8 +80,20 @@ set_time_limit(0); ...@@ -80,8 +80,20 @@ set_time_limit(0);
STARTBUSY("Starting event replay"); STARTBUSY("Starting event replay");
$retval = SUEXEC($uid, "$pid,$unix_gid", $retval = SUEXEC($uid, "$pid,$unix_gid",
"webeventsys_control replay $pid,$eid", "webeventsys_control replay $pid,$eid",
SUEXEC_ACTION_DIE); SUEXEC_ACTION_IGNORE);
STOPBUSY(); CLEARBUSY();
#
# Fatal Error. Report to the user, even though there is not much he can
# do with the error. Also reports to tbops.
#
if ($retval < 0) {
SUEXECERROR(SUEXEC_ACTION_DIE);
#
# Never returns ...
#
die("");
}
echo "Events for your experiment are now being replayed.\n"; echo "Events for your experiment are now being replayed.\n";
......
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