Commit 18859b83 authored by Austin Clements's avatar Austin Clements
Browse files

Various fixes to node setup. vnodesetup no longer has to be sudo'd

(necessary in order to play nicely with vnode_setup).  rc.vinit now
figures out he nodeid based on the file in which libsetup stores it.
parent 6348a02e
......@@ -68,14 +68,15 @@ if ($EUID != 0) {
}
#
# If not invoked as real root, then must be invoked as emulabman.
# If not invoked as real root, then must be invoked as emulabman or the
# Plab management user (emulab_EID_PID).
#
if ($UID) {
my ($pwname) = getpwuid($UID) or
die("*** $0:\n".
" $UID is not in the password file!\n");
if ($pwname ne "emulabman") {
if ($pwname ne "emulabman" && !($pwname =~ /emulab_[-\@\w]*_[-\@\w]*/)) {
die("*** $0:\n".
" You do not have permission to run this script!\n");
}
......
......@@ -32,7 +32,6 @@ if [ -s $BOOTDIR/startupcmd ]; then
$BINDIR/runstartup
fi
# XXX Can this run in Plab?
if [ -x $BINDIR/watchdog ]; then
echo "Starting update watchdog ..."
$BINDIR/watchdog start
......@@ -40,4 +39,5 @@ fi
echo "Informing the testbed that we're up and running ..."
$BINDIR/tmcc state ISUP
# XXX Oogly
$BINDIR/tmcc -n `cat /var/emulab/boot/plabname` state ISUP
......@@ -23,16 +23,22 @@
# bring up the vnode
#
# XXX Super-kludge to figure out vnodeid until the svm works
# Only works on Flux Plab nodes
VNODEID=`hostname -s | sed -e 's/planetlab\(.\)/pcplab\1/'`
if [ -e /home/utah6 ]; then
if [ -e /var/emulab/boot/plabname ]; then
VNODEID=`cat /var/emulab/boot/plabname`;
elif [ -e /etc/vnodeid ]; then
VNODEID=`cat /etc/vnodeid`;
else
# XXX Super-kludge to figure out vnodeid if unpacked by hand
# Only works on Flux Plab nodes
VNODEID=`hostname -s | sed -e 's/planetlab\(.\)/pcplab\1/'`
if [ -e /home/utah6 ]; then
VNODEID=${VNODEID}-1;
elif [ -e /home/utah7 ]; then
elif [ -e /home/utah7 ]; then
VNODEID=${VNODEID}-2;
else
echo Must run as utah6 or utah7;
else
echo Must run as utah6 or utah7 or be setup by Emulab svm
exit 1;
fi;
fi
# See how we were called.
......
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