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

Fix up problem with symlinks getting left behind from /proj to /groups.

parent 33de8f8c
...@@ -25,6 +25,7 @@ use Exporter; ...@@ -25,6 +25,7 @@ use Exporter;
PROJMEMBERTRUST_ROOT PROJMEMBERTRUST_GROUPROOT PROJMEMBERTRUST_ROOT PROJMEMBERTRUST_GROUPROOT
PROJMEMBERTRUST_PROJROOT PROJMEMBERTRUST_PROJROOT
PROJROOT GROUPROOT USERROOT
PLABMOND_PID PLABMOND_EID PLABHOLDING_PID PLABHOLDING_EID PLABMOND_PID PLABMOND_EID PLABHOLDING_PID PLABHOLDING_EID
TBTrustConvert TBMinTrust TBGrpTrust TBProjTrust TBTrustConvert TBMinTrust TBGrpTrust TBProjTrust
...@@ -192,7 +193,10 @@ my $EVENTSYS = "@EVENTSYS@"; ...@@ -192,7 +193,10 @@ my $EVENTSYS = "@EVENTSYS@";
my $BOSSNODE = "@BOSSNODE@"; my $BOSSNODE = "@BOSSNODE@";
my $TESTMODE = @TESTMODE@; my $TESTMODE = @TESTMODE@;
my $TBOPSPID = "emulab-ops"; my $TBOPSPID = "emulab-ops";
my $SCRIPTNAME = "Unknown"; my $SCRIPTNAME = "Unknown";
my $PROJROOT = "/proj";
my $GROUPROOT = "/groups";
my $USERROOT = "/users";
if ($EVENTSYS) { if ($EVENTSYS) {
require event; require event;
...@@ -277,6 +281,9 @@ sub PLABMOND_PID() { $TBOPSPID; } ...@@ -277,6 +281,9 @@ sub PLABMOND_PID() { $TBOPSPID; }
sub PLABMOND_EID() { "plab-monitor"; } sub PLABMOND_EID() { "plab-monitor"; }
sub PLABHOLDING_PID() { $TBOPSPID; } sub PLABHOLDING_PID() { $TBOPSPID; }
sub PLABHOLDING_EID() { "plabnodes"; } sub PLABHOLDING_EID() { "plabnodes"; }
sub PROJROOT() { $PROJROOT; }
sub GROUPROOT() { $GROUPROOT; }
sub USERROOT() { $USERROOT; }
sub NODEBOOTSTATUS_OKAY() { "okay" ; } sub NODEBOOTSTATUS_OKAY() { "okay" ; }
sub NODEBOOTSTATUS_FAILED() { "failed"; } sub NODEBOOTSTATUS_FAILED() { "failed"; }
...@@ -2527,6 +2534,7 @@ sub TBExptDestroy($$) ...@@ -2527,6 +2534,7 @@ sub TBExptDestroy($$)
my $workdir = TBExptWorkDir($pid, $eid); my $workdir = TBExptWorkDir($pid, $eid);
my $userdir = TBExptUserDir($pid, $eid); my $userdir = TBExptUserDir($pid, $eid);
my $gid = ExpGroup($pid, $eid);
# #
# Try to remove experiment directory. We allow for it not being there # Try to remove experiment directory. We allow for it not being there
...@@ -2544,6 +2552,12 @@ sub TBExptDestroy($$) ...@@ -2544,6 +2552,12 @@ sub TBExptDestroy($$)
print "*** WARNING: Not able to remove $workdir\n"; print "*** WARNING: Not able to remove $workdir\n";
print " Someone will need to do this by hand.\n"; print " Someone will need to do this by hand.\n";
} }
# Yuck.
if ($pid ne $gid) {
my $eidlink = "$PROJROOT/$pid/exp/$eid";
unlink($eidlink)
if (-l $eidlink);
}
# #
# Remove all trace from the DB. # Remove all trace from the DB.
......
...@@ -28,8 +28,8 @@ my $TBOPS = "@TBOPSEMAIL@"; ...@@ -28,8 +28,8 @@ my $TBOPS = "@TBOPSEMAIL@";
# #
# Should be configured. # Should be configured.
# #
my $projroot = "/proj"; my $projroot = PROJROOT();
my $grouproot= "/groups"; my $grouproot= GROUPROOT();
# #
# Testbed Support libraries # Testbed Support libraries
...@@ -172,7 +172,7 @@ if (! chown($UID, $unix_gid, "$workdir")) { ...@@ -172,7 +172,7 @@ if (! chown($UID, $unix_gid, "$workdir")) {
if ($pid ne $gid) { if ($pid ne $gid) {
# XXX Bad. This link should be removed when the experiment is removed. # XXX Bad. This link should be removed when the experiment is removed.
unlink($eidlink) unlink($eidlink)
if (-e $eidlink); if (-l $eidlink);
symlink($eiddir, $eidlink) or symlink($eiddir, $eidlink) or
fatal("Could not symlink($eiddir, $eidlink): $!"); fatal("Could not symlink($eiddir, $eidlink): $!");
} }
......
Supports Markdown
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