From b01e48ae0ef4f964a2ebf52a6f614ffe87ce0478 Mon Sep 17 00:00:00 2001 From: Mike Hibler Date: Tue, 4 Mar 2014 15:08:26 -0700 Subject: [PATCH] Copy over rc.mkelab and mkextrafs.pl to /var/run rather than /tmp. There apparently is a potential for problems due to the fact that we clear out /tmp after we start to run /tmp/rc.mkelab. --- clientside/tmcc/common/config/rc.mkelab | 6 +++--- tbsetup/elabinelab.in | 28 ++++++++++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/clientside/tmcc/common/config/rc.mkelab b/clientside/tmcc/common/config/rc.mkelab index 3ffa0073d..815e196fa 100755 --- a/clientside/tmcc/common/config/rc.mkelab +++ b/clientside/tmcc/common/config/rc.mkelab @@ -652,12 +652,12 @@ sub doboot() # # XXX Copy in new mkextrafs if necessary # - if (-e "/tmp/mkextrafs.pl") { + if (-e "/var/run/mkextrafs.pl") { # only copy if newer if (! -e "$BINDIR/mkextrafs.pl" || - (stat("/tmp/mkextrafs.pl"))[9] > + (stat("/var/run/mkextrafs.pl"))[9] > (stat("$BINDIR/mkextrafs.pl"))[9]) { - mysystem("cp /tmp/mkextrafs.pl $BINDIR/"); + mysystem("cp /var/run/mkextrafs.pl $BINDIR/"); } } diff --git a/tbsetup/elabinelab.in b/tbsetup/elabinelab.in index f8cd0470a..766fa8434 100644 --- a/tbsetup/elabinelab.in +++ b/tbsetup/elabinelab.in @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (c) 2004-2012 University of Utah and the Flux Group. +# Copyright (c) 2004-2014 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -319,6 +319,20 @@ $UID = 0; # XXX ugh, copy over a newer mkextrafs.pl as well (one that supports -2). # XXX ughII, we only copy over a FreeBSD version, this will break a Linux boss. # +# XXX ughIII, copy over to /var/run instead of /tmp since we run prepare +# from rc.mkelab and that cleans out /tmp. I thought this would work since +# /tmp/rc.mkelab would be open when /tmp was cleared and it would not affect +# execution of the script, but I actually had it fail once with: +# ... +# Building and Installing Software +# | Building (please be patient) /tmp/rc.mkelab: Command not found. +# +# right out of the middle of running the boss-install! This was on a VM with +# only 600MB of memory, so it is possible that due to memory pressure perl +# had not read the entire script? The build phase it started never actually +# happened. There was also no "phase stack dump" after that message, so +# everything got blown out of the water suddenly and decisively. +# my $mkelab = "$TB/etc/rc.mkelab"; if (-e "$expdir/rc.mkelab") { $mkelab = "$expdir/rc.mkelab"; @@ -333,16 +347,16 @@ print "/${opsnode}" print "/${fsnode}" if (defined($fsnode)); print "\n"; -system("scp $mkelab $mkextrafs ${bossnode}:/tmp"); -system("scp $mkelab $mkextrafs ${opsnode}:/tmp") +system("scp $mkelab $mkextrafs ${bossnode}:/var/run/"); +system("scp $mkelab $mkextrafs ${opsnode}:/var/run/") if (defined($opsnode)); -system("scp $mkelab $mkextrafs ${fsnode}:/tmp") +system("scp $mkelab $mkextrafs ${fsnode}:/var/run/") if (defined($fsnode)); if (defined($fsnode)) { TBDebugTimeStamp("Setting up fsnode"); print "Setting up fsnode on $fsnode\n"; - system("$SSH -host $fsnode /tmp/rc.mkelab -s -d > $fslogfile 2>&1"); + system("$SSH -host $fsnode /var/run/rc.mkelab -s -d > $fslogfile 2>&1"); if ($?) { $UID = $SAVEUID; SENDMAIL("$user_name <$user_email>", @@ -359,7 +373,7 @@ if (defined($fsnode)) { if (defined($opsnode)) { TBDebugTimeStamp("Setting up opsnode"); print "Setting up opsnode on $opsnode\n"; - system("$SSH -host $opsnode /tmp/rc.mkelab -s -d > $opslogfile 2>&1"); + system("$SSH -host $opsnode /var/run/rc.mkelab -s -d > $opslogfile 2>&1"); if ($?) { $UID = $SAVEUID; SENDMAIL("$user_name <$user_email>", @@ -375,7 +389,7 @@ if (defined($opsnode)) { } TBDebugTimeStamp("Setting up bossnode"); print "Setting up bossnode on $bossnode\n"; -system("$SSH -host $bossnode /tmp/rc.mkelab -s -d > $bosslogfile 2>&1"); +system("$SSH -host $bossnode /var/run/rc.mkelab -s -d > $bosslogfile 2>&1"); if ($?) { $UID = $SAVEUID; SENDMAIL("$user_name <$user_email>", -- GitLab