Commit decfb004 authored by Mike Hibler's avatar Mike Hibler

Add PKG_PATH, BOSS_PKG, OPS_PKG to values returned by emulabconfig command.

Also make a check to see if a client has a newer version than us and
complain if so.  Indicates that an older tmcd got installed.

Change one of the proctitle calls to not use info that is not yet available.
parent f3744926
......@@ -824,7 +824,7 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
#else
cp = (istcp ? "TCP" : "UDP");
#endif
setproctitle("%s: %s", reqp->nodeid, cp);
setproctitle("%s: %s", inet_ntoa(client->sin_addr), cp);
/*
* Init the req structure.
......@@ -852,9 +852,16 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
/*
* Look for VERSION.
* Check for clients that are newer than the server
* and complain.
*/
if (sscanf(bp, "VERSION=%d", &i) == 1) {
version = i;
if (version > CURRENT_VERSION) {
error("%s: version skew: server=%d, request=%d, "
"old TMCD installed?\n",
CURRENT_VERSION, version);
}
continue;
}
......@@ -5471,6 +5478,32 @@ COMMAND_PROTOTYPE(doemulabconfig)
}
}
mysql_free_result(res);
/*
* Finally, some package info
*/
res = mydb_query("select name,value from sitevariables "
"where name like 'elabinelab/%%'", 2);
if (!res) {
error("EMULABCONFIG: %s: DB Error getting elab_in_elab\n",
reqp->nodeid);
return 1;
}
nrows = (int)mysql_num_rows(res);
while (nrows--) {
row = mysql_fetch_row(res);
if (strcmp(row[0], "elabinelab/pkg_path") == 0) {
bufp += OUTPUT(bufp, ebufp - bufp, "PKG_PATH=%s\n",
row[1]);
} else if (strcmp(row[0], "elabinelab/boss_pkg") == 0) {
bufp += OUTPUT(bufp, ebufp - bufp, "BOSS_PKG=%s\n",
row[1]);
} else if (strcmp(row[0], "elabinelab/ops_pkg") == 0) {
bufp += OUTPUT(bufp, ebufp - bufp, "OPS_PKG=%s\n",
row[1]);
}
}
mysql_free_result(res);
client_writeback(sock, buf, strlen(buf), tcp);
return 0;
}
......
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