This is a follow-up to my last patch for syslog, motivated mainly by the
amount of log cruft present after resolving that issue.
dhclient is started on all interfaces during /bin/doxcat whether those
interfaces are connected or not. Since ethtool is present in the genesis
image for x86 the attached patch uses it to check for a link and only
starts dhclient on connected interfaces.
If there is a good way to configure/determine if IPv6 is NOT used in the
environment it would also be good to skip starting the v6 copies of
dhclient when it is unnecessary. Before I go and add something
unnecessary, is there currently a clean way to make this determination
(perhaps guided by the site table)? Thanks.
--
Daniel M. Weeks
Systems Administrator
Computational Center for Nanotechnology Innovations
Rensselaer Polytechnic Institute
Troy, NY 12180
518-276-4458
--- doxcat.orig 2013-03-15 11:54:27.510869692 -0400
+++ doxcat.1 2013-03-15 13:11:44.038862408 -0400
@@ -68,6 +68,7 @@
done
echo '};' >> /var/lib/lldpad/lldpad.conf
lldpad -d
+
dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic &
#we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce
#chances that we'll perform a partial discovery
@@ -76,8 +77,12 @@
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'`
export NICSTOBRINGUP
for nic in $NICSTOBRINGUP; do
- dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic &
- dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf var/lib/dhclient/dhclient6.leases $nic &
+ # only start dhclient if there is a link up to limit log cruft
+ ethtool $nic | grep "Link detected: yes" > /dev/null
+ if [ $? -eq 0 ]; then
+ dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic &
+ dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf var/lib/dhclient/dhclient6.leases $nic &
+ fi
done
openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 &
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user