Commit 73fc8257 authored by Leigh Stoller's avatar Leigh Stoller

Merge remote-tracking branch 'central/master' into imagealiases

parents 0fa38578 4f8e03a5
......@@ -1270,12 +1270,36 @@ sub handleCtrlEvent($$) {
"Giving up until it boots sucessfully.\n");
$nodes{$node}{noretry} = 1;
} else {
#
# XXX Temporary! For now notify instead of
# really rebooting, until the timeout/retry
# stuff is gone from os_setup and os_load
#
# XXX "temporary" is going on 13 years now and the
# lack of reboot does cause us grief. In particular,
# the case of NORMALv2/BOOTING, we can wind up here
# if a PXEWAKEUP at swap in is unsuccessful. We have
# seen this when IPMI SOL issues have caused the
# console and OS to hang up in the post-wakeup boot
# process or if the PXEWAKEUP is lost. Since there is
# only the overarching swapin timeout at this point,
# and that is typically quite large, we'll risk a
# bad timeout interaction.
#
# XXX recent changes have allowed us to better
# differentiate PXEBOOTING (PXE ROM making a DHCP
# request) from BOOTING (OS making a DHCP request)
# so we can detect nodes stuck booting the OS.
# We include those here in the "really reboot"
# catagory.
#
if ("$mode/$state" eq "NORMALv2/BOOTING" ||
$state eq "PXEBOOTING") {
handleCommand($node,$TBREBOOT,$timedout,1);
} else {
notify("Node $node has timed out in state ".
"$mode/$state - REBOOT requested\n");
#handleCommand($node,$TBREBOOT,$timedout,1);
}
}
last; };
/^$TBTIMEOUTNOTIFY/ && do {
......
......@@ -7507,8 +7507,10 @@ sub HandleBlockstore($$$$$$$@)
goto bad;
}
}
if (!defined($mount)) {
$message = "Missing blockstore mount point";
if (defined($mount) &&
!TBcheck_dbslot($mount, "os_info", "path",
TBDB_CHECKDBSLOT_WARN|TBDB_CHECKDBSLOT_ERROR)) {
$message = "Invalid mountpoint for blockstore";
goto bad;
}
if (!defined($readonly)) {
......@@ -7694,7 +7696,8 @@ sub HandleBlockstore($$$$$$$@)
goto bad;
}
}
push(@attributes, ["mountpoint", $mount, 0]);
push(@attributes, ["mountpoint", $mount, 0])
if (defined($mount) && $mount ne "");
push(@attributes, ["placement", $placement, 0]);
push(@attributes, ["readonly", $readonly, 0]);
push(@attributes, ["class", ($class eq "local" ? "local" : "SAN"), 1]);
......
......@@ -2655,7 +2655,7 @@ COMMAND_PROTOTYPE(doaccounts)
{
MYSQL_RES *res;
MYSQL_ROW row;
char buf[MYBUFSIZE];
char buf[MYBUFSIZE], leader[TBDB_FLEN_UID];
int nrows, gidint;
int tbadmin, didwidearea = 0, nodetypeprojects = 0;
int didnonlocal = 0;
......@@ -2675,6 +2675,31 @@ COMMAND_PROTOTYPE(doaccounts)
return 1;
}
/*
* We need the group leader below.
*/
res = mydb_query("select leader from groups "
"where pid='%s' and gid='%s'",
1, reqp->pid, reqp->gid);
if (res) {
row = mysql_fetch_row(res);
if (row[0]) {
strcpy(leader, row[0]);
}
else {
error("%s: accounts: No leader for %s/%s\n",
reqp->nodeid, reqp->pid, reqp->gid);
mysql_free_result(res);
return 1;
}
mysql_free_result(res);
}
else {
error("%s: accounts: Could not get leader for %s/%s\n",
reqp->nodeid, reqp->pid, reqp->gid);
return 1;
}
/*
* See if a per-node-type set of projects is specified for accounts.
*/
......@@ -3077,14 +3102,14 @@ COMMAND_PROTOTYPE(doaccounts)
MYSQL_RES *pubkeys_res;
MYSQL_RES *sfskeys_res;
int pubkeys_nrows, sfskeys_nrows, i, root = 0;
int auxgids[128], gcount = 0, leader;
int auxgids[128], gcount = 0, isleader;
char glist[BUFSIZ];
char *bufp = buf, *ebufp = &buf[sizeof(buf)];
char *pswd, *wpswd, wpswd_buf[9];
gidint = -1;
tbadmin = root = atoi(row[8]);
leader = 0;
isleader = 0;
gcount = 0;
while (1) {
......@@ -3107,8 +3132,9 @@ COMMAND_PROTOTYPE(doaccounts)
(strcmp(row[4], "group_root") == 0) ||
(strcmp(row[4], "project_root") == 0))
root = 1;
if (strcmp(row[4], "project_root") == 0)
leader = 1;
if (strcmp(leader, row[0]) == 0)
isleader = 1;
}
else {
int k, newgid = atoi(row[7]);
......@@ -3210,7 +3236,7 @@ COMMAND_PROTOTYPE(doaccounts)
* of the ssh accounts that came in with the Geni API call.
*/
if (reqp->genisliver_idx && reqp->isnonlocal_pid &&
!didnonlocal && !leader)
!didnonlocal && !isleader)
goto skipkeys;
if (gidint == -1) {
......
......@@ -112,8 +112,8 @@ function guess_node_type($proc,$disk) {
($disk < ($HD * (1.0 + $fudge_factor)))) {
if ($node_type != "") {
# We found two potential matches, choose neither
echo "Found a second match ($type), bailing\n";
return "";
echo "Found another match ($type), using that\n";
$node_type = $type;
} else {
echo "Found a first match ($type)\n";
$node_type = $type;
......
......@@ -205,7 +205,7 @@ while ($row = mysql_fetch_array($query_result)) {
"value='$mac'></td>\n";
echo "<td><input type='text' name='iface${card}_type' size=5 " .
"value='$type'></td>\n";
echo "<td><input type='text' name='iface${card}_switch_id' size=10 " .
echo "<td><input type='text' name='iface${card}_switch_id' size=16 " .
"value='$switch_id'></td>\n";
echo "<td><input type='text' name='iface${card}_switch_card' size=3 " .
"value='$switch_card'></td>\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