* [Patch] chunkd: add ForceHost
@ 2009-09-29 21:13 Pete Zaitcev
2009-09-30 21:31 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2009-09-29 21:13 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
Add the same crutch that tabled has, to help with misconfigured build
machines.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
diff -urp -X dontdiff chunkd/server/config.c chunkd-force/server/config.c
--- chunkd/server/config.c 2009-09-17 12:13:12.150697912 -0600
+++ chunkd-force/server/config.c 2009-09-29 15:01:38.626224517 -0600
@@ -256,6 +256,12 @@ static void cfg_elm_end (GMarkupParseCon
cc->text = NULL;
}
+ else if (!strcmp(element_name, "ForceHost") && cc->text) {
+ free(chunkd_srv.ourhost);
+ chunkd_srv.ourhost = cc->text;
+ cc->text = NULL;
+ }
+
else if (!strcmp(element_name, "Path") && cc->text) {
if (stat(cc->text, &st) < 0) {
applog(LOG_ERR, "stat(2) cfgfile Path '%s' failed: %s",
diff -urp -X dontdiff chunkd/server/server.c chunkd-force/server/server.c
--- chunkd/server/server.c 2009-09-17 12:13:12.158754062 -0600
+++ chunkd-force/server/server.c 2009-09-29 15:00:33.946198861 -0600
@@ -1284,7 +1284,11 @@ int main (int argc, char *argv[])
* early as possible, so that tunables are available.
*/
read_config();
- chunkd_srv.ourhost = get_hostname();
+ if (!chunkd_srv.ourhost)
+ chunkd_srv.ourhost = get_hostname();
+ else if (debugging)
+ applog(LOG_INFO, "Forcing local hostname to %s",
+ chunkd_srv.ourhost);
/*
* For example, backgrounding and PID file should be done early
diff -urp -X dontdiff chunkd/test/server-test.cfg chunkd-force/test/server-test.cfg
--- chunkd/test/server-test.cfg 2009-09-17 12:13:12.175697488 -0600
+++ chunkd-force/test/server-test.cfg 2009-09-29 15:08:09.520239669 -0600
@@ -1,4 +1,5 @@
+<ForceHost>localhost.localdomain</ForceHost>
<SSL>
<PrivateKey>ssl-key.pem</PrivateKey>
<Cert>ssl-cert.pem</Cert>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-30 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29 21:13 [Patch] chunkd: add ForceHost Pete Zaitcev
2009-09-30 21:31 ` Jeff Garzik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.