From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch] chunkd: add ForceHost
Date: Tue, 29 Sep 2009 15:13:08 -0600 [thread overview]
Message-ID: <20090929151308.6e7a7136@redhat.com> (raw)
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>
next reply other threads:[~2009-09-29 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 21:13 Pete Zaitcev [this message]
2009-09-30 21:31 ` [Patch] chunkd: add ForceHost Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090929151308.6e7a7136@redhat.com \
--to=zaitcev@redhat.com \
--cc=hail-devel@vger.kernel.org \
--cc=jeff@garzik.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.