Commit 7b396e75 authored by Mike Hibler's avatar Mike Hibler

Add another piece of the frisbee heartbeat puzzle.

Make sure that when a subboss fetches from its parent, it uses the
heartbeat option (if enabled).
parent 9bb15935
......@@ -322,6 +322,8 @@ install: $(INSTALL_SBINDIR)/mfrisbeed $(INSTALL_SBINDIR)/frisbeed $(INSTALL_SBIN
subboss-install: subboss
$(MAKE) WITH_MSERVER_EMULAB=0 install
$(INSTALL_PROGRAM) frisbee $(DESTDIR)/usr/local/bin/frisbee
$(INSTALL_PROGRAM) frisupload $(DESTDIR)/usr/local/bin/frisupload
client: frisbee frisupload
......
......@@ -462,6 +462,18 @@ set_get_values(struct config_host_authinfo *ai, int ix)
ii->put_itimeout = 0;
ii->put_options = NULL;
ii->put_oldversion = NULL;
/*
* parent GET options:
* - if we are making client reports, make sure that our downloads
* from a parent enable those.
* XXX right now, the server always dictates the interval.
*/
if (get_clientreport > 0) {
snprintf(str, sizeof str, " -H 0");
ii->pget_options = mystrdup(str);
} else
ii->pget_options = NULL;
}
/*
......@@ -511,6 +523,9 @@ set_put_values(struct config_host_authinfo *ai, int ix)
ii->get_methods = 0;
ii->get_timeout = 0;
ii->get_options = NULL;
/* and the pget_* fields */
ii->pget_options = NULL;
}
#define FREE(p) { if (p) free(p); }
......@@ -535,6 +550,7 @@ emulab_free_host_authinfo(struct config_host_authinfo *ai)
FREE(ai->imageinfo[i].get_options);
FREE(ai->imageinfo[i].put_oldversion);
FREE(ai->imageinfo[i].put_options);
FREE(ai->imageinfo[i].pget_options);
FREE(ai->imageinfo[i].extra);
}
free(ai->imageinfo);
......
......@@ -213,6 +213,18 @@ set_get_values(struct config_host_authinfo *ai, int ix)
ai->imageinfo[ix].put_itimeout = 0;
ai->imageinfo[ix].put_oldversion = NULL;
ai->imageinfo[ix].put_options = NULL;
/*
* parent GET options:
* - if we are making client reports, make sure that our downloads
* from a parent enable those.
* XXX right now, the server always dictates the interval.
*/
if (clientreport > 0) {
snprintf(str, sizeof str, " -H 0");
ai->imageinfo[ix].pget_options = mystrdup(str);
} else
ai->imageinfo[ix].pget_options = NULL;
}
/*
......@@ -244,6 +256,9 @@ set_put_values(struct config_host_authinfo *ai, int ix)
ii->get_methods = 0;
ii->get_timeout = 0;
ii->get_options = NULL;
/* and pget fields */
ii->pget_options = NULL;
}
#define FREE(p) { if (p) free(p); }
......@@ -268,6 +283,7 @@ null_free_host_authinfo(struct config_host_authinfo *ai)
FREE(ai->imageinfo[i].get_options);
FREE(ai->imageinfo[i].put_oldversion);
FREE(ai->imageinfo[i].put_options);
FREE(ai->imageinfo[i].pget_options);
FREE(ai->imageinfo[i].extra);
}
free(ai->imageinfo);
......
/*
* Copyright (c) 2010-2017 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
* This file is part of the Emulab network testbed software.
*
* This file is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this file. If not, see <http://www.gnu.org/licenses/>.
*
* }}}
*/
#include <netinet/in.h>
#include <arpa/inet.h>
......@@ -34,6 +57,7 @@ struct config_imageinfo {
int put_timeout; /* max time to allow PUT server to run */
int put_itimeout; /* max time to allow per-socket-op to run */
char *put_oldversion; /* where to save the old version */
char *pget_options; /* options for parent-fetch client */
void *extra; /* config-type specific info */
};
......
/*
* Copyright (c) 2010-2016 University of Utah and the Flux Group.
* Copyright (c) 2010-2017 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -329,6 +329,8 @@ free_imageinfo(struct config_imageinfo *ii)
free(ii->put_oldversion);
if (ii->put_options)
free(ii->put_options);
if (ii->pget_options)
free(ii->pget_options);
free(ii);
}
}
......@@ -381,6 +383,9 @@ copy_imageinfo(struct config_imageinfo *ii)
nii->put_maxsize = ii->put_maxsize;
nii->put_timeout = ii->put_timeout;
nii->put_itimeout = ii->put_itimeout;
if (ii->pget_options &&
(nii->pget_options = strdup(ii->pget_options)) == NULL)
goto fail;
/* XXX don't care about extra right now */
return nii;
......@@ -1849,9 +1854,11 @@ startchild(struct childinfo *ci)
}
case PTYPE_CLIENT:
pname = FRISBEE_CLIENT;
opts = ci->imageinfo->pget_options ?
ci->imageinfo->pget_options : "";
snprintf(argbuf, sizeof argbuf,
"%s -N -S %s -i %s %s %s -m %s %s %s",
pname, servstr, ifacestr,
"%s -N -S %s -i %s %s %s %s -m %s %s %s",
pname, servstr, ifacestr, opts,
debug > 1 ? "" : "-q",
ci->method == CONFIG_IMAGE_UCAST ? "-O" :
(ci->method == CONFIG_IMAGE_BCAST ? "-b" : ""),
......
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