From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: [Patch 2/4] chunkd: make NID not mandatory Date: Mon, 10 Aug 2009 19:01:26 -0600 Message-ID: <20090810190126.782cda9b@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: Project Hail List 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 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);