Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
45eeacd6
Commit
45eeacd6
authored
Sep 20, 2007
by
Leigh B. Stoller
Browse files
Minor bug fixes.
parent
8631118c
Changes
3
Hide whitespace changes
Inline
Side-by-side
tbsetup/template_swapin.in
View file @
45eeacd6
...
...
@@ -209,14 +209,18 @@ $SIG{TERM} = \&sighandler;
#
# Use the logonly option to audit so that we get a record mailed.
#
if
(
!
(
$foreground
||
$experiment
->
batchmode
())
)
{
if
(
!
$foreground
)
{
# Cleanup
$experiment
->
CleanLogFiles
()
==
0
or
fatal
(
-
1
,
"
Could not clean up logfiles!
");
$logname
=
TBExptCreateLogFile
(
$pid
,
$eid
,
"
swapin
");
TBExptSetLogFile
(
$pid
,
$eid
,
$logname
);
TBExptOpenLogFile
(
$pid
,
$eid
);
# The batch daemon is going to set the current log file, so do not do it.
if
(
!
$experiment
->
batchmode
())
{
TBExptSetLogFile
(
$pid
,
$eid
,
$logname
);
TBExptOpenLogFile
(
$pid
,
$eid
);
}
if
(
my
$childpid
=
AuditStart
(
LIBAUDIT_DAEMON
,
$logname
,
LIBAUDIT_LOGONLY
|
LIBAUDIT_NODELETE
|
LIBAUDIT_FANCY
))
{
...
...
@@ -360,8 +364,6 @@ if ($experiment->batchmode()) {
if
(
!
@ExptStates
);
foreach
my
$state
(
@ExptStates
)
{
print
"
$state
\n
";
if
(
$state
eq
EXPTSTATE_ACTIVATING
())
{
print
"
Experiment is starting a swapin attempt ...
\n
";
}
...
...
@@ -383,10 +385,13 @@ if ($experiment->batchmode()) {
# Dumped out of the batch system for some reason.
print
"
Experiment has been removed from the batch queue.
\n
";
$instance
->
DeleteCurrentRun
()
==
0
or
exit
(
-
1
);
#
# We are done
; remove record of this attempt and exit
.
# We are done
. User has to requeue batched instance
.
#
fatal
(
1
,
"
Experiment has been removed from the batch queue
"
);
exit
(
0
);
}
}
}
...
...
tbsetup/template_swapout.in
View file @
45eeacd6
...
...
@@ -164,13 +164,18 @@ if (!defined($experiment)) {
fatal
(
-
1
,
"
Experiment
$pid
/
$eid
object could not be found!
");
}
# Check for cancel.
# Check for cancel
and dequeue
.
if
(
!
$batchmode
)
{
if
(
$experiment
->
state
()
eq
EXPTSTATE_ACTIVATING
)
{
system
("
$swapexp
-x -s out
$pid
$eid
");
exit
(
$?
>>
8
);
}
# Check for a pre-loaded instance (never active).
elsif
(
$experiment
->
batchmode
()
&&
$experiment
->
state
()
eq
EXPTSTATE_QUEUED
)
{
# User wants to dequeue a batch experiment that is waiting to go.
system
("
$swapexp
-x -s pause
$pid
$eid
");
exit
(
$?
>>
8
);
}
}
#
...
...
www/swapexp.php3
View file @
45eeacd6
...
...
@@ -90,9 +90,6 @@ $lockdown = $experiment->lockdown();
# Template Instance Experiments get special treatment in this page.
$instance
=
TemplateInstance
::
LookupByExptidx
(
$exptidx
);
if
(
$instance
&&
(
$inout
!=
"out"
&&
$inout
!=
"in"
))
{
PAGEARGERROR
(
"Invalid action for template instance"
);
}
# Convert inout to informative text.
if
(
!
strcmp
(
$inout
,
"in"
))
{
...
...
@@ -119,6 +116,8 @@ elseif (!strcmp($inout, "pause")) {
$action
=
"dequeue"
;
}
elseif
(
!
strcmp
(
$inout
,
"restart"
))
{
if
(
$instance
)
PAGEARGERROR
(
"Invalid action for template instance"
);
$action
=
"restart"
;
}
...
...
@@ -219,8 +218,9 @@ if ($instance) {
$guid
=
$instance
->
guid
();
$version
=
$instance
->
vers
();
STARTBUSY
((
$inout
==
"out"
?
"Terminating"
:
"Starting"
)
.
" template instance!"
);
STARTBUSY
(
"Template Instance is"
);
if
(
$inout
==
"pause"
)
$inout
=
"out"
;
}
#
...
...
@@ -269,10 +269,7 @@ if ($retval) {
echo
"<blockquote><pre>
$suexec_output
<pre></blockquote>"
;
}
else
{
if
(
$instance
)
{
STARTLOG
(
$experiment
);
}
elseif
(
$isbatch
)
{
if
(
$isbatch
)
{
if
(
strcmp
(
$inout
,
"in"
)
==
0
)
{
echo
"Batch Mode experiments will be run when enough resources
become available. This might happen immediately, or it
...
...
@@ -293,11 +290,14 @@ else {
please contact
$TBMAILADDR
.
\n
"
;
}
elseif
(
strcmp
(
$inout
,
"pause"
)
==
0
)
{
echo
"Your experiment has been dequeued.
You may requeue your
echo
"Your experiment has been dequeued.
experiment at any time.
\n
"
;
}
STARTWATCHER
(
$experiment
);
}
elseif
(
$instance
)
{
STARTLOG
(
$experiment
);
}
else
{
echo
"<div>"
;
if
(
strcmp
(
$inout
,
"out"
)
==
0
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment