From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch 2/4] chunkd: make NID not mandatory
Date: Mon, 10 Aug 2009 19:01:26 -0600 [thread overview]
Message-ID: <20090810190126.782cda9b@redhat.com> (raw)
It's useful to quit with an error message if a user plainly forgets
to configure NID, but on the other hand someone might want to test
something or such. Maybe add a --standalone option for that?
Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
diff --git a/server/cldu.c b/server/cldu.c
index 74bbd22..2835b2d 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -507,6 +507,8 @@ int cld_begin(const char *thishost, const char *thiscell, uint32_t nid,
cld_ops.printf = log;
+ if (!nid)
+ return 0;
cldc_init();
/*
@@ -574,6 +576,9 @@ void cld_end(void)
{
int i;
+ if (!ses.nid)
+ return;
+
if (ses.lib) {
event_del(&ses.ev);
// if (ses.sess_open) /* kill it always, include half-open */
diff --git a/server/config.c b/server/config.c
index f577dc6..dc97587 100644
--- a/server/config.c
+++ b/server/config.c
@@ -449,10 +449,17 @@ void read_config(void)
}
if (chunkd_srv.nid == 0) { /* We have no NID, it's fatal */
+#if 0 /* Not having NID is made non-fatal, because of CLD-less applications */
if (!ctx.badnid) { /* NID is missing (not invalid) */
applog(LOG_ERR, "No NID configured");
}
exit(1);
+#else
+ if (ctx.badnid)
+ exit(1);
+ if (debugging)
+ applog(LOG_DEBUG, "No NID configured");
+#endif
}
free(ctx.geo_area);
reply other threads:[~2009-08-11 1:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090810190126.782cda9b@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.