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

Several tweaks to last revision for batch daemon.

parent 429136f3
...@@ -100,6 +100,7 @@ use Exporter; ...@@ -100,6 +100,7 @@ use Exporter;
TBExptOpenLogFile TBExptCloseLogFile TBExptCreateLogFile TBExptOpenLogFile TBExptCloseLogFile TBExptCreateLogFile
TBNodeUpdateAccountsByPid TBNodeUpdateAccountsByType TBNodeUpdateAccountsByPid TBNodeUpdateAccountsByType
TBSaveExpLogFiles TBExptWorkDir TBExptUserDir TBExptLogDir TBSaveExpLogFiles TBExptWorkDir TBExptUserDir TBExptLogDir
TBExptDestroy
TBDB_WIDEAREA_LOCALNODE TBDB_WIDEAREA_LOCALNODE
TBWideareaNodeID TBWideareaNodeID
...@@ -1800,6 +1801,49 @@ sub TBExptCreateLogFile($$$) ...@@ -1800,6 +1801,49 @@ sub TBExptCreateLogFile($$$)
return $logname; 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!). # Get the control network IP for a node (underlying physical node!).
# #
......
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