* [Patch 2/4] chunkd: make NID not mandatory
@ 2009-08-11 1:01 Pete Zaitcev
0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2009-08-11 1:01 UTC (permalink / raw)
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 <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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-11 1:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 1:01 [Patch 2/4] chunkd: make NID not mandatory Pete Zaitcev
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.