Commit 70a9bf5a authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add check for existence of /usr/local/etc/bossnode to find the name of

the boss. The resolver goo is not going to work on RON nodes.
parent a0d271ab
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
#include "config.h" #include "config.h"
#undef BOSSNODE #undef BOSSNODE
#ifdef BOSSNODE
#define DEFAULT_BOSSNODE BOSSNODE
#else
#define DEFAULT_BOSSNODE NULL
#endif
#define BOSSNODEFILE "/usr/local/etc/bossnode"
void sigcatcher(int foo); void sigcatcher(int foo);
char *getbossnode(void); char *getbossnode(void);
...@@ -51,7 +57,7 @@ main(int argc, char **argv) ...@@ -51,7 +57,7 @@ main(int argc, char **argv)
struct hostent *he; struct hostent *he;
struct in_addr serverip; struct in_addr serverip;
char buf[MYBUFSIZE], *bp, *response = ""; char buf[MYBUFSIZE], *bp, *response = "";
char *bossnode = NULL; char *bossnode = DEFAULT_BOSSNODE;
int version = CURRENT_VERSION; int version = CURRENT_VERSION;
#ifdef UDP #ifdef UDP
int useudp = 0; int useudp = 0;
...@@ -85,6 +91,26 @@ main(int argc, char **argv) ...@@ -85,6 +91,26 @@ main(int argc, char **argv)
} }
argv += optind; argv += optind;
/*
* How do we find our bossnode?
*
* 1. Command line.
* 2. Compiled in.
* 3. /usr/local/etc/bossnode
* 4. nameserver goo below.
*/
if (!bossnode) {
FILE *fp;
if ((fp = fopen(BOSSNODEFILE, "r")) != NULL) {
if (fgets(buf, sizeof(buf), fp)) {
if ((bp = strchr(buf, '\n')))
*bp = (char) NULL;
bossnode = strdup(buf);
}
fclose(fp);
}
}
if (!bossnode) if (!bossnode)
bossnode = getbossnode(); bossnode = getbossnode();
he = gethostbyname(bossnode); he = gethostbyname(bossnode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment