All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit ecd89038 authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 76a97f6c 5fc7c476
......@@ -39,7 +39,7 @@ THISHOMEBASE=Emulab.Net
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
WINSUPPORT=1
ELVIN_COMPAT=1
ELVIN_COMPAT=0
NSVERIFY=1
# Set to one to disable exporting NFS filesystems to nodes
......
#!/bin/sh
#
# Fiecely bogus script to attempt to upgrade ports on an existing Emulab server
# Fiercely bogus script to attempt to upgrade ports on an existing Emulab server
#
#DO=echo
DO=
DO=echo
#DO=
if [ -z "$1" ]; then
echo '*** Usage: update-ports [boss|ops]'
......
......@@ -178,6 +178,10 @@ ENHANCEMENTS:
Minor changes would be needed to PacketSend/Recv to track the client
IP/port rather than just assuming/using the global mcastaddr/portnum.
One nice side-effect of this is that the client would no longer have
to bind to a specific port in the unicast case, since each reply from
the server could be tagged with the proper destination port.
9. Allow the frisbee client to be used in a pipe.
If we could pipe the output of frisbee into another utility, this would
......
......@@ -506,16 +506,23 @@ while (my %row = $db_result->fetchhash()) {
}
#
# XXX Inner elab nodes should never report in to us.
# If they do, make sure they wind up in PXEWAIT.
# XXX Inner elab fu.
# 1. If nodes try to report in to us, make sure they wind up in PXEWAIT
# (ClearOsids)
# 2. Make sure nodes appear successfully allocated
# (SetBootStatus, SetAllocState)
# Note that they will appear to be in PXEWAIT via the web interface.
# Maybe we should
#
if (keys(%einenodes)) {
DBQueryFatal("update nodes set ".
" def_boot_osid=NULL,".
" next_boot_osid=NULL,".
" temp_boot_osid=NULL ".
"where node_id in (".
join(",", map("'$_'", keys %einenodes)). ")");
foreach my $node (keys %einenodes) {
my $nodeobj = $nodeobjs{$node};
if ($nodeobj) {
$nodeobj->ClearOsids();
$nodeobj->SetBootStatus(NODEBOOTSTATUS_OKAY);
$nodeobj->SetAllocState(TBDB_ALLOCSTATE_RES_READY());
}
}
}
@all_nodes = (keys %nodes, keys %vnodes);
......
......@@ -28,11 +28,17 @@ if ($UID != 0) {
#
sub usage()
{
print STDOUT "Usage: reload_daemon [-d]\n" .
"Use the -d option to prevent daemonization\n";
print STDOUT "Usage: reload_daemon [-d] [-t tag]\n" .
" -d Prevent daemonization\n" .
" -t tag Only manage reloads for nodes or node types\n" .
" that have the value of <tag> for a node_type_attribute\n" .
" or a node_attribute named 'reload_daemon_tag'.\n" .
" IF this tag is not set, the reload_daemon picks only\n" .
" those nodes that DO NOT have this type or node\n" .
" attribute set!\n";
exit(-1);
}
my $optlist = "d";
my $optlist = "dt:";
#
# Configure variables
......@@ -72,6 +78,7 @@ my $reboot = "$TB/bin/node_reboot";
my $tbrsync = "$TB/bin/tbrsync";
my $logfile = "$TB/log/reloadlog";
my $debug = 0;
my $tag;
my $retry_time = 20; # in minutes
my $warn_time = $retry_time * 2; # in minutes
my $widearea_multiplier = 2; # widearea nodes get (mult+1)x longer, but
......@@ -110,11 +117,17 @@ if (@ARGV != 0) {
if (defined($options{"d"})) {
$debug = $options{"d"};
}
if (defined($options{"t"})) {
$tag = $options{"t"};
# rename the logfile too
$logfile = "$logfile-$tag";
}
#
# Only one please.
# Only one please (for the default reload_daemon). If you specified
# a tag, it's your problem.
#
if (CheckDaemonRunning("reload_daemon")) {
if (!defined($tag) && CheckDaemonRunning("reload_daemon")) {
fatal("Not starting another reload daemon!");
}
......@@ -124,7 +137,7 @@ if (! $debug) {
exit(0);
}
}
if (MarkDaemonRunning("reload_daemon")) {
if (!defined($tag) && MarkDaemonRunning("reload_daemon")) {
fatal("Could not mark daemon as running!");
}
#
......@@ -158,6 +171,29 @@ while (1) {
#
my $time = time();
#
# If we are the default reload daemon (i.e., have no tag for our
# reload_pool), only look for nodes that have neither a reload_pool
# node_type_attribute nor a node_attribute.
#
# If we have a reload_pool tag, only pick up nodes that
# * have our tag for the node_type_attribute, and our tag or NULL
# for the node_attribute, OR
# * have our tag for the node attribute.
#
my $tag_query = '';
if (!defined($tag)) {
$tag_query = 'and nta_reload_pool.attrvalue is NULL' .
' and na_reload_pool.attrvalue is NULL';
}
else {
$tag_query = "" .
" and ((nta_reload_pool.attrvalue='$tag' and" .
" (na_reload_pool.attrvalue='$tag'" .
" or na_reload_pool.attrvalue is NULL))" .
" or na_reload_pool.attrvalue='$tag')";
}
#
# First, look for nodes that have been in the reloading experiment for
# longer than $retry_time, and try rebooting them
......@@ -170,9 +206,16 @@ while (1) {
DBQueryWarn("select r.node_id,r.mustwipe from reserved as r" .
" left join nodes as n on r.node_id=n.node_id" .
" left join node_types as nt on n.type=nt.type " .
"where r.pid='$RELOADPID' and r.eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL ($retry_time * (r.mustwipe + 1) + (nt.isremotenode * $retry_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time");
" left outer join (select type,attrvalue from node_type_attributes" .
" where attrkey='reload_daemon_pool') as nta_reload_pool" .
" on n.type=nta_reload_pool.type" .
" left outer join (select node_id,attrvalue from node_attributes" .
" where attrkey='reload_daemon_pool') as na_reload_pool" .
" on r.node_id=na_reload_pool.node_id" .
" where r.pid='$RELOADPID' and r.eid='$RELOADEID' and" .
" (CURRENT_TIMESTAMP - INTERVAL ($retry_time * (r.mustwipe + 1) + (nt.isremotenode * $retry_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time" .
" $tag_query");
if (! $query_result) {
print "DB Error. Waiting a bit.\n";
......@@ -230,9 +273,16 @@ while (1) {
DBQueryWarn("select r.node_id,r.mustwipe from reserved as r" .
" left join nodes as n on r.node_id=n.node_id" .
" left join node_types as nt on n.type=nt.type " .
"where r.pid='$RELOADPID' and r.eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL ($warn_time * (mustwipe + 1) + (nt.isremotenode * $warn_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time");
" left outer join (select type,attrvalue from node_type_attributes" .
" where attrkey='reload_daemon_pool') as nta_reload_pool" .
" on n.type=nta_reload_pool.type" .
" left outer join (select node_id,attrvalue from node_attributes" .
" where attrkey='reload_daemon_pool') as na_reload_pool" .
" on r.node_id=na_reload_pool.node_id" .
" where r.pid='$RELOADPID' and r.eid='$RELOADEID' and " .
" (CURRENT_TIMESTAMP - INTERVAL ($warn_time * (mustwipe + 1) + (nt.isremotenode * $warn_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time" .
" $tag_query");
if (! $query_result) {
print "DB Error. Waiting a bit.\n";
......@@ -273,9 +323,16 @@ while (1) {
"from reserved as b ".
"left join nodes as a on a.node_id=b.node_id ".
"left join last_reservation as l on l.node_id=a.node_id ".
"left join node_types as n on n.type=a.type where ".
"(b.node_id is null and $CLASSCLAUSE and l.pid!='') ".
"or (b.pid='$RELOADPID' and b.eid='$PENDINGEID') ".
"left join node_types as n on n.type=a.type ".
" left outer join (select type,attrvalue from node_type_attributes" .
" where attrkey='reload_daemon_pool') as nta_reload_pool" .
" on n.type=nta_reload_pool.type" .
" left outer join (select node_id,attrvalue from node_attributes" .
" where attrkey='reload_daemon_pool') as na_reload_pool" .
" on b.node_id=na_reload_pool.node_id" .
" where ((b.node_id is null and $CLASSCLAUSE and l.pid!='') ".
"or (b.pid='$RELOADPID' and b.eid='$PENDINGEID')) ".
" $tag_query " .
"order by a.node_id");
if (! $query_result) {
......
......@@ -783,7 +783,11 @@ sub SetupFsNode()
print RC "ntpdate_enable=\"YES\"\n";
print RC "ntpdate_flags=\"boss\"\n";
print RC "xntpd_enable=\"YES\"\n";
if ($FBSD_VERSION >= 5) {
print RC "ntpd_enable=\"YES\"\n";
} else {
print RC "xntpd_enable=\"YES\"\n";
}
print RC "linux_enable=\"YES\"\n";
print RC "rpcbind_enable=\"YES\"\n";
......@@ -1196,7 +1200,11 @@ sub SetupOpsNode($)
print RC "ntpdate_enable=\"YES\"\n";
print RC "ntpdate_flags=\"boss\"\n";
print RC "xntpd_enable=\"YES\"\n";
if ($FBSD_VERSION >= 5) {
print RC "ntpd_enable=\"YES\"\n";
} else {
print RC "xntpd_enable=\"YES\"\n";
}
print RC "linux_enable=\"YES\"\n";
print RC "accounting_enable=\"YES\"\n";
......
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