Commit 7d7c0999 authored by Mike Hibler's avatar Mike Hibler
Browse files

Hackery to make sure that Plab slices always have boss/ops in their hosts

file: we return info for boss/ops in the "hostnames" command, but only if
the command would have otherwise returned something.

This is because the default hosts file we distribute in the rootball already
has boss/ops in it.  But if, during bootup, tmcd returns hostname info, that
hosts file gets overwritten and boss/ops info gets lost.

I could just grep out the info from the original hosts file and transfer it
to the one we are building, but what do I grep for: "boss", "ops",
"emulab.net"?  Don't really want to hardwire any of those in the client-side
script.

By returning this info via tmcd, I also don't have to modify the client-side
and thus don't need to build a new rootball!
parent f8d3f970
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
#undef JAILIPMASK #undef JAILIPMASK
#undef BOSSNODE #undef BOSSNODE
#undef BOSSNODE_IP #undef BOSSNODE_IP
#undef EXTERNAL_BOSSNODE_IP
#undef USERNODE #undef USERNODE
#undef USERNODE_IP #undef USERNODE_IP
#undef EXTERNAL_USERNODE_IP
#undef FSNODE #undef FSNODE
#undef FSNODE_IP #undef FSNODE_IP
#undef OURDOMAIN #undef OURDOMAIN
......
...@@ -1416,6 +1416,7 @@ done ...@@ -1416,6 +1416,7 @@ done
# #
...@@ -1582,6 +1583,10 @@ cat >> confdefs.h <<EOF ...@@ -1582,6 +1583,10 @@ cat >> confdefs.h <<EOF
#define BOSSNODE_IP "$BOSSNODE_IP" #define BOSSNODE_IP "$BOSSNODE_IP"
EOF EOF
cat >> confdefs.h <<EOF
#define EXTERNAL_BOSSNODE_IP "$EXTERNAL_BOSSNODE_IP"
EOF
cat >> confdefs.h <<EOF cat >> confdefs.h <<EOF
#define USERNODE "$USERNODE" #define USERNODE "$USERNODE"
EOF EOF
...@@ -1590,6 +1595,10 @@ cat >> confdefs.h <<EOF ...@@ -1590,6 +1595,10 @@ cat >> confdefs.h <<EOF
#define USERNODE_IP "$USERNODE_IP" #define USERNODE_IP "$USERNODE_IP"
EOF EOF
cat >> confdefs.h <<EOF
#define EXTERNAL_USERNODE_IP "$EXTERNAL_USERNODE_IP"
EOF
cat >> confdefs.h <<EOF cat >> confdefs.h <<EOF
#define FSNODE "$FSNODE" #define FSNODE "$FSNODE"
EOF EOF
...@@ -2057,17 +2066,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h ...@@ -2057,17 +2066,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2060: checking for $ac_hdr" >&5 echo "configure:2070: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2065 "configure" #line 2075 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2106,17 +2115,17 @@ for ac_hdr in linux/videodev.h ...@@ -2106,17 +2115,17 @@ for ac_hdr in linux/videodev.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2109: checking for $ac_hdr" >&5 echo "configure:2119: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2114 "configure" #line 2124 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2149,7 +2158,7 @@ done ...@@ -2149,7 +2158,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2152: checking for $ac_word" >&5 echo "configure:2162: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2228,7 +2237,7 @@ fi ...@@ -2228,7 +2237,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2231: checking for a BSD compatible install" >&5 echo "configure:2241: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2289,7 +2298,7 @@ esac ...@@ -2289,7 +2298,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args. # Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2 set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2292: checking for $ac_word" >&5 echo "configure:2302: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
......
...@@ -302,8 +302,10 @@ AC_DEFINE_UNQUOTED(JAILIPBASE, "$JAILIPBASE") ...@@ -302,8 +302,10 @@ AC_DEFINE_UNQUOTED(JAILIPBASE, "$JAILIPBASE")
AC_DEFINE_UNQUOTED(JAILIPMASK, "$JAILIPMASK") AC_DEFINE_UNQUOTED(JAILIPMASK, "$JAILIPMASK")
AC_DEFINE_UNQUOTED(BOSSNODE, "$BOSSNODE") AC_DEFINE_UNQUOTED(BOSSNODE, "$BOSSNODE")
AC_DEFINE_UNQUOTED(BOSSNODE_IP, "$BOSSNODE_IP") AC_DEFINE_UNQUOTED(BOSSNODE_IP, "$BOSSNODE_IP")
AC_DEFINE_UNQUOTED(EXTERNAL_BOSSNODE_IP, "$EXTERNAL_BOSSNODE_IP")
AC_DEFINE_UNQUOTED(USERNODE, "$USERNODE") AC_DEFINE_UNQUOTED(USERNODE, "$USERNODE")
AC_DEFINE_UNQUOTED(USERNODE_IP, "$USERNODE_IP") AC_DEFINE_UNQUOTED(USERNODE_IP, "$USERNODE_IP")
AC_DEFINE_UNQUOTED(EXTERNAL_USERNODE_IP, "$EXTERNAL_USERNODE_IP")
AC_DEFINE_UNQUOTED(FSNODE, "$FSNODE") AC_DEFINE_UNQUOTED(FSNODE, "$FSNODE")
if test -n "$FSNODE_IP"; then if test -n "$FSNODE_IP"; then
AC_DEFINE_UNQUOTED(FSNODE_IP, "$FSNODE_IP") AC_DEFINE_UNQUOTED(FSNODE_IP, "$FSNODE_IP")
......
...@@ -2626,6 +2626,24 @@ COMMAND_PROTOTYPE(dohosts) ...@@ -2626,6 +2626,24 @@ COMMAND_PROTOTYPE(dohosts)
host = host->next; host = host->next;
hostcount++; hostcount++;
} }
/*
* For plab slices, lets include boss and ops IPs as well
* in case of flaky name service on the nodes.
*
* XXX we only do this if we were going to return something
* otherwise. In the event there are no other hosts, we would
* not overwrite the existing hosts file which already has boss/ops.
*/
if (reqp->isplabdslice && hostcount > 0) {
OUTPUT(buf, sizeof(buf),
"NAME=%s IP=%s ALIASES=''\nNAME=%s IP=%s ALIASES=''\n",
BOSSNODE, EXTERNAL_BOSSNODE_IP,
USERNODE, EXTERNAL_USERNODE_IP);
client_writeback(sock, buf, strlen(buf), tcp);
hostcount += 2;
}
#if 0 #if 0
/* /*
* List of control net addresses for jailed nodes. * List of control net addresses for jailed nodes.
......
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