Commit d1ca5359 authored by Mike Hibler's avatar Mike Hibler

Partial fix to FS#137 concerning plab nodes with broken nameserver setups

that cannot resolve even their own name.

Put a check in the generated rc.plab to see if the node can ping itself
(i.e., that its hostname resolves).  If not, we put an entry for ourselves
in /etc/hosts.

This does not solve the general problem of a bad nameserver, but allows
our infrastructure to completely setup.  Whether this is a step forward or
not is debatable, but it makes me feel all warm inside.
parent 6703712b
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -318,6 +318,15 @@ sub doplabconfig()
print RC "setconfigopt /etc/resolv.conf domain emulab.net\n";
print RC "setconfigopt /etc/resolv.conf search emulab.net\n\n";
# XXX make sure we can resolve our own name
print RC "if ! ping -c 1 `hostname` >/dev/null 2>&1; then\n".
" myip=`cat /var/emulab/boot/myip`\n".
" myhn=`hostname`\n".
" if [ -n \"\$myip\" -a -n \"\$myhn\" ]; then\n".
" setconfigopt /etc/hosts \$myip \$myhn\n".
" fi\n".
"fi\n";
# No SSH X11 Forwarding
print RC "setconfigopt /etc/ssh/sshd_config X11Forwarding no\n";
......
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