diff options
Diffstat (limited to 'overlay/sys-cluster/beowulf-head/files/node-manager')
-rwxr-xr-x | overlay/sys-cluster/beowulf-head/files/node-manager | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/overlay/sys-cluster/beowulf-head/files/node-manager b/overlay/sys-cluster/beowulf-head/files/node-manager index 9ae348c..509a9df 100755 --- a/overlay/sys-cluster/beowulf-head/files/node-manager +++ b/overlay/sys-cluster/beowulf-head/files/node-manager @@ -6,12 +6,25 @@ MODULESPATH=%%MODULESPATH BEEPS=%%BEEPS +beeps(){ + ### Beeps: + PAUSE=20 + START=200 + STOP=2000 + STEP=200 + BEEP_add="$(for I in `seq $START $STEP $STOP`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)" + BEEP_del="$(for I in `seq $STOP -$STEP $START`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)" + BEEP_add="beep ${BEEP_add%%-n}" + BEEP_del="beep ${BEEP_del%%-n}" + eval \$BEEP_$COMMAND +} + run_modules(){ for I in ${MODULESPATH}/*-${COMMAND} do $I $@ done - [ $BEEPS ] && eval \$BEEP_$COMMAND + [ $BEEPS ] && beeps } # Yes, it's crude but we'll elaborate later on something more functionnal @@ -34,33 +47,16 @@ old_node(){ usage(){ echo "$0 is called as follows:" - echo "$0 <add|del|old> <MAC address> <IP address> <hostname>" + echo "$0 <add|del> <MAC address> <IP address> <hostname> <processor count> [number of processors]" + echo "If [number of processors] is not set, the default one is used from the clustering config file when needed." } - -if [[ $# != 4 ]]; then -# We just ignore the call without a hostname -# usage; -# - exit 0; -fi - - ##### Variables ####### COMMAND=$1 MACADDR=$2 IP=$3 HNAME=$4 -### Beeps: -PAUSE=20 -START=200 -STOP=2000 -STEP=200 -BEEP_add="$(for I in `seq $START $STEP $STOP`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)" -BEEP_del="$(for I in `seq $STOP -$STEP $START`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)" -BEEP_add="beep ${BEEP_add%%-n}" -BEEP_del="beep ${BEEP_del%%-n}" ##### Variables END ### @@ -68,9 +64,17 @@ if [[ $COMMAND == "old" ]] then # we background this since it performs a ping with a 1second timeout # on a 256 node system, those seconds add up... - old_node $@ & + if [[ $# -lt 5 ]]; then + # We ignore calls made with odl and only 4 args as we're missing the + # processor count. This can be caused by dnsmasq reloading + # or dnsmasq not setting DNSMASQ_USER_CLASS0 as it seems to happen often + # on subsequent dhcp requests made by the client. + exit 0 + else + old_node $@ $DNSMASQ_USER_CLASS0 & + fi else - run_modules $@ + run_modules $@ $DNSMASQ_USER_CLASS0 fi exit 0 |