Goal: Fix bashism See http://bugs.debian.org/530064 Author: Mathieu Parent Upstream status: https://bugzilla.samba.org/show_bug.cgi?id=6407 Index: b/config/events.d/00.ctdb =================================================================== --- a/config/events.d/00.ctdb +++ b/config/events.d/00.ctdb @@ -27,7 +27,11 @@ # periodic vacuum function periodic_vacuum() { # this cleans up dead records and repacks the databases - ( time ctdb vacuum 200000 -T 30; time ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 & + if [ "$(command -v time)" ]; then + ( time ctdb vacuum 200000 -T 30; time ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 & + else + ( ctdb vacuum 200000 -T 30; ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 & + fi } case $cmd in Index: b/config/events.d/11.natgw =================================================================== --- a/config/events.d/11.natgw +++ b/config/events.d/11.natgw @@ -44,7 +44,7 @@ delete_all - if [ "$MYPNN" == "$NATGWMASTER" ]; then + if [ "$MYPNN" = "$NATGWMASTER" ]; then # This is the first node, set it up as the NAT GW echo 1 >/proc/sys/net/ipv4/ip_forward iptables -A POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK -d ! $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE Index: b/config/events.d/20.multipathd =================================================================== --- a/config/events.d/20.multipathd +++ b/config/events.d/20.multipathd @@ -87,7 +87,7 @@ monitor) multipathd_check - [ "$?" == "0" ] || { + [ "$?" = "0" ] || { echo 20.multipathd: monitoring of multipathing failed exit 1 } Index: b/config/events.d/61.nfstickle =================================================================== --- a/config/events.d/61.nfstickle +++ b/config/events.d/61.nfstickle @@ -25,13 +25,12 @@ takeip) iface=$1 ip=$2 - shopt -s nullglob # first send a grat arp, to ensure the client knows the updated # mac address for this IP ctdb gratiousarp $ip $iface # send tickle acks for all the connections the old server had for f in $NFS_TICKLE_SHARED_DIRECTORY/*/$ip; do - cat $f | while read dest; do + [ -f $f ] && cat $f | while read dest; do dip=`echo $dest | cut -d: -f1` dport=`echo $dest | cut -d: -f2` # send three, in case of lost packets