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-devel
Commits
7ed2f334
Commit
7ed2f334
authored
Sep 17, 2002
by
Leigh B. Stoller
Browse files
Several tweaks to last revision for batch daemon.
parent
429136f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/libdb.pm.in
View file @
7ed2f334
...
...
@@ -100,6 +100,7 @@ use Exporter;
TBExptOpenLogFile
TBExptCloseLogFile
TBExptCreateLogFile
TBNodeUpdateAccountsByPid
TBNodeUpdateAccountsByType
TBSaveExpLogFiles
TBExptWorkDir
TBExptUserDir
TBExptLogDir
TBExptDestroy
TBDB_WIDEAREA_LOCALNODE
TBWideareaNodeID
...
...
@@ -1800,6 +1801,49 @@ sub TBExptCreateLogFile($$$)
return $logname;
}
#
# Destroy an experiment and cleanup all traces. Used from several
# different scripts, so localized here.
#
sub TBExptDestroy($$)
{
my($pid, $eid) = @_;
my $workdir = TBExptWorkDir($pid, $eid);
my $userdir = TBExptUserDir($pid, $eid);
#
# Try to remove experiment directory. We allow for it not being there
# cause we often run the tb programs directly. We also allow for not
# having permission, in the case that an admin type is running this,
# in which case it won't be allowed cause of directory permissions. Thats
# okay since admin types should rarely end experiments in other projects.
#
print "Removing experiment directories ... \n";
if (system("/bin/rm -rf $userdir")) {
print "*** WARNING: Not able to remove $userdir\n";
print " Someone will need to do this by hand.\n";
}
if (system("/bin/rm -rf $workdir")) {
print "*** WARNING: Not able to remove $workdir\n";
print " Someone will need to do this by hand.\n";
}
#
# Remove all trace from the DB.
#
DBQueryWarn("DELETE from nsfiles ".
"WHERE eid='$eid' and pid='$pid'");
DBQueryWarn("DELETE from exppid_access ".
"WHERE exp_eid='$eid' and exp_pid='$pid'");
DBQueryWarn("DELETE from experiments ".
"WHERE eid='$eid' and pid='$pid'");
return 0;
}
#
# Get the control network IP for a node (underlying physical node!)
.
#
...
...
Write
Preview
Supports
Markdown
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