This looks reasonable, although there is a typo in the second line: cdhclient -> dhclient
The loop could potentially be expanded to always poll ethtool and bring the dhclient up *and* down as appropriate but that may be to much of a corner case for the effort. On 03/15/2013 03:57 PM, Jarrod B Johnson wrote: > Here's what I applied to testing on the ethtool check: > $ git show 16642a0810a0756879fd068cc051bd5c67711891 > commit 16642a0810a0756879fd068cc051bd5c67711891 > Author: jbjohnso <jbjohnso@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd> > Date: Fri Mar 15 19:56:00 2013 +0000 > > Test change to reduce dhclient activity - as suggested by Daniel Weeks > > git-svn-id: > https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15537 > 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd > > diff --git a/xCAT-genesis-scripts/bin/doxcat > b/xCAT-genesis-scripts/bin/doxcat > index 6c53990..59d45da 100755 > --- a/xCAT-genesis-scripts/bin/doxcat > +++ b/xCAT-genesis-scripts/bin/doxcat > @@ -82,8 +82,8 @@ dhclient -6 -pf /var/run/dhclient6.$bootnic.pid > $bootnic -lf /var/lib/dhclient/d > 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 & > + (while ! ethtool $nic | grep Link\ detected|grep yes > > /dev/null; do sleep 5; done; cdhclient -cf /etc/dhclient.conf -pf > /var/run/dhclient.$nic.pid $nic ) & > + (while ! ethtool $nic | grep Link\ detected|grep yes > > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf > /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhc > done > openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & > > I need to try it out before putting it in the 2.8 stream, but I think > that might be a good compromise. > > Inactive hide details for "Daniel M. Weeks" ---03/15/2013 02:00:19 > PM---I can agree to some extent - you likely will have the n"Daniel M. > Weeks" ---03/15/2013 02:00:19 PM---I can agree to some extent - you > likely will have the necessary information on the DHCP server. Howe > > From: "Daniel M. Weeks" <[email protected]> > To: xCAT Users Mailing list <[email protected]> > Cc: Jarrod B Johnson/Raleigh/IBM@IBMUS > Date: 03/15/2013 02:00 PM > Subject: Re: [xcat-user] genesis: limit DHCP startup to connected interfaces > > ------------------------------------------------------------------------ > > > > I can agree to some extent - you likely will have the necessary > information on the DHCP server. However, if you put yourself in the > place of an installer or sysadmin: would you want the additional > complexity of looking in another separate log when diagnosing a problem > or "following along" during a boot, having to match timestamps or > interleave 2+ logs? Furthermore, consider a situation where that DHCP > server is handled by a different person or group within the organization > and access to those logs is restricted - there would be another big > hurdle to solving what could otherwise be very straight-forward. > > Besides that, isn't it just silly to bring up DHCP on an interface that > doesn't have the cable? (Yes, always having it running covers the > situation where a machine is booted and then a cable is plugged in > afterwards. However, I think connecting to the node on the boot NIC > (which will always have DHCP running) and starting DHCP on the second > interface is an order of magnitude less work than connecting the cable > already was. This is even more true if it's multiple systems or multiple > cables thanks to psh.) > > On 03/15/2013 01:39 PM, Jarrod B Johnson wrote: >> I would personally be leaning toward suppressing dhclient induced >> logging messages or at most logging them to ramdisk. Given the fact >> that the server also logs and the dhcp server is almost always a server >> within convenient reach, I don't think the syslog having dhclient >> messages from genesis is a big enough value given the cost. >> >> Inactive hide details for "Daniel M. Weeks" ---03/15/2013 01:24:48 >> PM---This is a follow-up to my last patch for syslog, motiva"Daniel M. >> Weeks" ---03/15/2013 01:24:48 PM---This is a follow-up to my last patch >> for syslog, motivated mainly by the amount of log cruft present >> >> From: "Daniel M. Weeks" <[email protected]> >> To: xCAT Users Mailing list <[email protected]> >> Date: 03/15/2013 01:24 PM >> Subject: [xcat-user] genesis: limit DHCP startup to connected interfaces >> >> ------------------------------------------------------------------------ >> >> >> >> 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 >> [attachment "doxcat-only_connected.patch" deleted by Jarrod B >> Johnson/Raleigh/IBM] >> > ------------------------------------------------------------------------------ >> 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 >> >> >> >> > ------------------------------------------------------------------------------ >> 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 >> > > > -- > Daniel M. Weeks > Systems Administrator > Computational Center for Nanotechnology Innovations > Rensselaer Polytechnic Institute > Troy, NY 12180 > 518-276-4458 > > -- Daniel M. Weeks Systems Administrator Computational Center for Nanotechnology Innovations Rensselaer Polytechnic Institute Troy, NY 12180 518-276-4458 ------------------------------------------------------------------------------ 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
