update custom services dev_tr65_lma_1001_iso_maker
authorLaurent Mazet <laurent.mazet@thalesgroup.com>
Thu, 13 Nov 2014 16:13:14 +0000 (17:13 +0100)
committerLaurent Mazet <laurent.mazet@thalesgroup.com>
Thu, 13 Nov 2014 16:13:14 +0000 (17:13 +0100)
master/etc/init.d/etherwake
master/etc/init.d/waitslaves
master/etc/init.d/wakeonlan

index 4c10152fe658553e7ad165057cd7fd990d4ca468..401992e9c37564c16bdf113271e9eba2a61b6636 100755 (executable)
@@ -28,7 +28,7 @@ VER=1.3
 
 DHCPCONF=/etc/dhcp/dhcpd.conf
 GROUP_SIZE=5
-NB_TRY=1
+NB_TRY=2
 ENABLE="yes"
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
@@ -41,10 +41,11 @@ do_start () {
 
     log_action_msg "Activate EtherWake"
 
+    sleep 1
     n=0
     while [ $NB_TRY -gt 0 ]; do
 
-        for mac in $(awk '{sub(/#.*/, "")} /trc[0-9]/ && /-rf/ {gsub(/;/, " "); print $6}' $DHCPCONF); do
+        for mac in $(awk '{sub(/#.*/, "")} /trc[0-9]/ {gsub(/;/, " "); print $6}' $DHCPCONF); do
             host=$(awk '{sub(/#.*/, "")} /'$mac'/ {print $2}' $DHCPCONF)
 
             log_action_msg "Wake-up $host ($mac)"
index 2354742817aa4c12f0a946bf77a9970dc90201fc..4bacb1bee340dabcc3f2aed35e67ecf2063401c3 100755 (executable)
@@ -12,8 +12,8 @@ VER=1.0
 # Required-Start:    $network $sshd isc-dhcp-server atftpd nfs-kernel-server wakeonlan etherwake
 # Required-Stop:
 # Should-Start:
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
+# Default-Start:     S
+# Default-Stop:      
 # Short-Description: Wait cluster slave blades
 # Description:       Wait for all cluster slave blades are ready for running
 ### END INIT INFO
index a91473a494360f5abf312d4225d414b6fe39a298..2a36ed8244595b3508fcfc7f8002e250a1a16252 100755 (executable)
@@ -39,10 +39,10 @@ do_start () {
 
     log_action_msg "Activate Wake On Lan"
 
-    mac=$(awk '{ sub(/#.*/, "") } /trc[0-9]/ && ! /-rf/ { gsub(/;/, " "); print $6}' $DHCPCONF)
-    broadcast=$(ip add show dev eth1 |awk '$1=="inet" {sub(/\/.*/, ""); sub(/\.[0-9]*$/, ".255", $2); print $2; exit}')
+    mac=$(awk '{ sub(/#.*/, "") } /trc[0-9]/ { gsub(/;/, " "); print $6}' $DHCPCONF)
 
     for m in $mac; do
+       broadcast=$(grep $m /etc/dhcp/dhcpd.conf | sed 's/.* \([0-9.]*\)\..*/\1.255/')
         log_action_msg "Wake-up $broadcast ($m)"
         wakeonlan -p 7 -i $broadcast $m
     done