Commit 7683b1e3 authored by Mike Hibler's avatar Mike Hibler
Browse files

Changes to fire-off rc.startcmd after ISUP is reported.

Will only affect the MFSes and other internal uses, does NOT impact
user specified start commands.
parent 6dff6a40
......@@ -80,8 +80,7 @@ my @bootscripts;
if (MFS()) {
@bootscripts = ("rc.misc", "rc.localize", "rc.mounts", "rc.accounts",
"rc.hostnames", "rc.keys", "rc.tarfiles",
"rc.rpms", "rc.startcmd");
"rc.hostnames", "rc.keys", "rc.tarfiles", "rc.rpms");
}
elsif (WINDOWS()) {
@bootscripts = ("rc.misc", ##"rc.localize",
......@@ -91,9 +90,7 @@ elsif (WINDOWS()) {
"rc.hostnames", "rc.syncserver",
# rc.progagent is run by a separate service named ProgAgent.
# It's started by EmulabStartup after rc.bootsetup runs.
"rc.tarfiles", "rc.rpms",
"rc.startcmd"
);
"rc.tarfiles", "rc.rpms");
}
else {
@bootscripts = ("rc.firewall",
......@@ -103,7 +100,7 @@ else {
"rc.hostnames", "rc.trace",
"rc.syncserver", "rc.trafgen",
"rc.tarfiles", "rc.rpms", "rc.progagent", "rc.linkagent",
"rc.tiptunnels", "rc.startcmd", "rc.simulator");
"rc.tiptunnels", "rc.simulator");
}
# Execute the action.
......
......@@ -323,10 +323,24 @@ sub doboot()
fatal("Error sending ISUP to Emulab Control!");
}
#
# After everything is setup, run any startup command.
#
# Note that this mechanism is only used for the admin MFS now,
# regular user startup commands are run via the program agent.
#
if (-x "$RCDIR/rc.startcmd") {
TBDebugTimeStamp("running $RCDIR/rc.startcmd");
system("$RCDIR/rc.startcmd boot");
if ($?) {
fatal("Error running $RCDIR/rc.startcmd");
}
}
#
# Boot vnodes. Doing it after ISUP is better; os_setup will
# consider the node ready, and move onto waiting for vnodes to
# boot. Ditto for subnodes belowl which should be merged with vnodes.
# boot. Ditto for subnodes below which should be merged with vnodes.
#
if (-x "$BINDIR/bootvnodes") {
print("Booting up vnodes\n");
......@@ -344,6 +358,7 @@ sub doboot()
fatal("Error running $BINDIR/bootsubnodes");
}
}
# we are done!
return;
......
......@@ -61,8 +61,12 @@ if (background()) {
#
exit 0;
}
#
# Delay to allow the boot to complete.
sleep(30);
# We are fired off last thing, so the boot should be pretty much done.
#
sleep(5);
#
# Open up the command file, which tells us what to do.
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -132,6 +132,20 @@ sub doboot()
if (tmcc(TMCCCMD_STATE, "ISUP") < 0) {
fatal("Error sending ISUP to Emulab Control!");
}
#
# After everything is setup, run any startup command.
#
# Note that this mechanism is only used for the admin MFS now,
# regular user startup commands are run via the program agent.
#
if (-x "$RCDIR/rc.startcmd") {
TBDebugTimeStamp("running $RCDIR/rc.startcmd");
system("$RCDIR/rc.startcmd boot");
if ($?) {
fatal("Error running $RCDIR/rc.startcmd");
}
}
}
#
......
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