[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Fri Jul 22 07:33:01 UTC 2022


The branch, master has been updated
       via  e396eb9fbc7 ctdb-scripts: Only run unhealthy call-out when passing threshold
       via  36bd6fd01f2 ctdb-scripts: Always check memory usage
       via  5e7bbcb069e ctdb-scripts: Avoid ShellCheck info SC2162
       via  dc7aaca889a ctdb-scripts: Reduce length of very long lines
       via  fc485feae81 ctdb-scripts: De-clutter validate_percentage()
       via  a832c8e273d ctdb-scripts: Reformat using shfmt -w -p -i 0 -fn
       via  3df39aa7fbd ctdb-scripts: Avoid ShellCheck warning SC2164
      from  21b9734cf2e smbd: Bypass the vfs_gethandle data for default share IPC$

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e396eb9fbc7b843181cf095051221305ff3578ed
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:32:01 2022 +1000

    ctdb-scripts: Only run unhealthy call-out when passing threshold
    
    For memory usage, no need to dump all of this data on every failed
    monitor event.  The first call will be enough to diagnose the problem.
    The node will then go unhealthy, drop clients and memory usage should
    then drop.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Fri Jul 22 07:32:54 UTC 2022 on sn-devel-184

commit 36bd6fd01f2c42d818c47f7b49567c40c1aeb5b6
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:03:41 2022 +1000

    ctdb-scripts: Always check memory usage
    
    If filesystem usage exceeds the unhealthy threshold then checking
    memory usage checking is not done.  Always do them both.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 5e7bbcb069e45ae30bc53e9f32f3f12a7461d34d
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:28:56 2022 +1000

    ctdb-scripts: Avoid ShellCheck info SC2162
    
    SC2162 (info): read without -r will mangle backslashes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit dc7aaca889a3a4d6d20b8091324ecc50e0a5a1e6
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jun 30 08:55:28 2022 +1000

    ctdb-scripts: Reduce length of very long lines
    
    Use printf to allow easier line breaks and use some early returns.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit fc485feae818c939e6f12999c7b066c1208a931a
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:17:28 2022 +1000

    ctdb-scripts: De-clutter validate_percentage()
    
    It always takes 2 arguments.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit a832c8e273dc18ab9a67ed2ed1fa98202d822f10
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:13:22 2022 +1000

    ctdb-scripts: Reformat using shfmt -w -p -i 0 -fn
    
    About to modify this file, so reformat first as per recent Samba
    convention.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3df39aa7fbd6f8712fda3d90a9c595e7d6aadeef
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 10 10:11:27 2022 +1000

    ctdb-scripts: Avoid ShellCheck warning SC2164
    
    SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
    
    A problem can only occur if /etc/ctdb/ or an important subdirectory is
    removed, which means the script itself would not be found.  Use && to
    silence ShellCheck.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/config/ctdb-crash-cleanup.sh                  |   2 +-
 ctdb/config/debug-hung-script.sh                   |   2 +-
 ctdb/config/debug_locks.sh                         |   2 +-
 ctdb/config/events/legacy/00.ctdb.script           |   2 +-
 ctdb/config/events/legacy/01.reclock.script        |   2 +-
 ctdb/config/events/legacy/05.system.script         | 255 +++++++++++----------
 ctdb/config/events/legacy/06.nfs.script            |   2 +-
 ctdb/config/events/legacy/10.interface.script      |   2 +-
 ctdb/config/events/legacy/11.natgw.script          |   2 +-
 ctdb/config/events/legacy/11.routing.script        |   2 +-
 ctdb/config/events/legacy/13.per_ip_routing.script |   2 +-
 ctdb/config/events/legacy/20.multipathd.script     |   2 +-
 ctdb/config/events/legacy/31.clamd.script          |   2 +-
 ctdb/config/events/legacy/40.vsftpd.script         |   2 +-
 ctdb/config/events/legacy/41.httpd.script          |   2 +-
 ctdb/config/events/legacy/48.netbios.script        |   2 +-
 ctdb/config/events/legacy/49.winbind.script        |   2 +-
 ctdb/config/events/legacy/50.samba.script          |   2 +-
 ctdb/config/events/legacy/60.nfs.script            |   2 +-
 ctdb/config/events/legacy/70.iscsi.script          |   2 +-
 ctdb/config/events/legacy/91.lvs.script            |   2 +-
 ctdb/config/statd-callout                          |   2 +-
 ctdb/tests/UNIT/shellcheck/scripts/local.sh        |   5 +-
 23 files changed, 160 insertions(+), 142 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/ctdb-crash-cleanup.sh b/ctdb/config/ctdb-crash-cleanup.sh
index 896a90cda98..95cfd75981f 100755
--- a/ctdb/config/ctdb-crash-cleanup.sh
+++ b/ctdb/config/ctdb-crash-cleanup.sh
@@ -5,7 +5,7 @@
 #
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; echo "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && echo "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/debug-hung-script.sh b/ctdb/config/debug-hung-script.sh
index 03d5ea2f6a0..c1ac0f1e1ad 100755
--- a/ctdb/config/debug-hung-script.sh
+++ b/ctdb/config/debug-hung-script.sh
@@ -4,7 +4,7 @@
 # for other operating systems.
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; echo "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && echo "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/debug_locks.sh b/ctdb/config/debug_locks.sh
index b2e20250f5a..6c730ee1802 100755
--- a/ctdb/config/debug_locks.sh
+++ b/ctdb/config/debug_locks.sh
@@ -22,7 +22,7 @@
 #   accompanying patch.
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; echo "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && echo "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/00.ctdb.script b/ctdb/config/events/legacy/00.ctdb.script
index b1c9890e751..81c16af08a0 100755
--- a/ctdb/config/events/legacy/00.ctdb.script
+++ b/ctdb/config/events/legacy/00.ctdb.script
@@ -4,7 +4,7 @@
 # elsewhere.
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/01.reclock.script b/ctdb/config/events/legacy/01.reclock.script
index ab0f2f6a32b..04068750efa 100755
--- a/ctdb/config/events/legacy/01.reclock.script
+++ b/ctdb/config/events/legacy/01.reclock.script
@@ -2,7 +2,7 @@
 # script to check accessibility to the reclock file on a node
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/05.system.script b/ctdb/config/events/legacy/05.system.script
index 08e401a9e73..56a07c7cc77 100755
--- a/ctdb/config/events/legacy/05.system.script
+++ b/ctdb/config/events/legacy/05.system.script
@@ -1,8 +1,8 @@
 #!/bin/sh
 # ctdb event script for checking local file system utilization
 
-[ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+[ -n "$CTDB_BASE" ] ||
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
@@ -10,133 +10,153 @@ load_script_options
 
 ctdb_setup_state_dir "service" "system-monitoring"
 
-validate_percentage ()
+validate_percentage()
 {
-    case "$1" in
-	"") return 1 ;;  # A failure that doesn't need a warning
-	[0-9]|[0-9][0-9]|100) return 0 ;;
-	*) echo "WARNING: ${1} is an invalid percentage${2:+ in \"}${2}${2:+\"} check"
-	   return 1
-    esac
+	case "$1" in
+	"") return 1 ;; # A failure that doesn't need a warning
+	[0-9] | [0-9][0-9] | 100) return 0 ;;
+	*)
+		echo "WARNING: ${1} is an invalid percentage in \"${2}\" check"
+		return 1
+		;;
+	esac
 }
 
-check_thresholds ()
+check_thresholds()
 {
-    _thing="$1"
-    _thresholds="$2"
-    _usage="$3"
-    _unhealthy_callout="$4"
+	_thing="$1"
+	_thresholds="$2"
+	_usage="$3"
+	_unhealthy_callout="$4"
 
-    case "$_thresholds" in
+	case "$_thresholds" in
 	*:*)
-	    _warn_threshold="${_thresholds%:*}"
-	    _unhealthy_threshold="${_thresholds#*:}"
-	    ;;
+		_warn_threshold="${_thresholds%:*}"
+		_unhealthy_threshold="${_thresholds#*:}"
+		;;
 	*)
-	    _warn_threshold="$_thresholds"
-	    _unhealthy_threshold=""
-    esac
-
-    _t=$(echo "$_thing" | sed -e 's@/@SLASH_ at g' -e 's@ @_ at g')
-    # script_state_dir set by ctdb_setup_state_dir()
-    # shellcheck disable=SC2154
-    _cache="${script_state_dir}/cache_${_t}"
-    if validate_percentage "$_unhealthy_threshold" "$_thing" ; then
-        if [ "$_usage" -ge "$_unhealthy_threshold" ] ; then
-	    echo "ERROR: ${_thing} utilization ${_usage}% >= threshold ${_unhealthy_threshold}%"
-	    eval "$_unhealthy_callout"
-	    echo "$_usage" >"$_cache"
-	    exit 1
-        fi
-    fi
-
-    if validate_percentage "$_warn_threshold" "$_thing" ; then
-        if [ "$_usage" -ge "$_warn_threshold" ] ; then
-	    if [ -r "$_cache" ] ; then
-		read _prev <"$_cache"
-	    else
-		_prev=""
-	    fi
-	    if [ "$_usage" != "$_prev" ] ; then
-		echo "WARNING: ${_thing} utilization ${_usage}% >= threshold ${_warn_threshold}%"
-		echo "$_usage" >"$_cache"
-	    fi
+		_warn_threshold="$_thresholds"
+		_unhealthy_threshold=""
+		;;
+	esac
+
+	_t=$(echo "$_thing" | sed -e 's@/@SLASH_ at g' -e 's@ @_ at g')
+	# script_state_dir set by ctdb_setup_state_dir()
+	# shellcheck disable=SC2154
+	_cache="${script_state_dir}/cache_${_t}"
+	if [ -r "$_cache" ]; then
+		read -r _prev <"$_cache"
 	else
-	    if [ -r "$_cache" ] ; then
-		echo "NOTICE: ${_thing} utilization ${_usage}% < threshold ${_warn_threshold}%"
-	    fi
-	    rm -f "$_cache"
-        fi
-    fi
+		_prev=0
+	fi
+	if validate_percentage "$_unhealthy_threshold" "$_thing"; then
+		if [ "$_usage" -ge "$_unhealthy_threshold" ]; then
+			printf 'ERROR: %s utilization %d%% >= threshold %d%%\n' \
+			       "$_thing" \
+			       "$_usage" \
+			       "$_unhealthy_threshold"
+			# Only run unhealthy callout if passing the
+			# unhealthy threshold.  That is, if the
+			# previous usage was below the threshold.
+			if [ "$_prev" -lt "$_unhealthy_threshold" ]; then
+				eval "$_unhealthy_callout"
+			fi
+			echo "$_usage" >"$_cache"
+			exit 1
+		fi
+	fi
+
+	if validate_percentage "$_warn_threshold" "$_thing"; then
+		if [ "$_usage" -ge "$_warn_threshold" ]; then
+			if [ "$_usage" = "$_prev" ]; then
+				return
+			fi
+			printf 'WARNING: %s utilization %d%% >= threshold %d%%\n' \
+			       "$_thing" \
+			       "$_usage" \
+			       "$_warn_threshold"
+			echo "$_usage" >"$_cache"
+		else
+			if [ ! -r "$_cache" ]; then
+				return
+			fi
+			printf 'NOTICE: %s utilization %d%% < threshold %d%%\n' \
+			       "$_thing" \
+			       "$_usage" \
+			       "$_warn_threshold"
+			rm -f "$_cache"
+		fi
+	fi
 }
 
-set_monitor_filsystem_usage_defaults ()
+set_monitor_filsystem_usage_defaults()
 {
-    _fs_defaults_cache="${script_state_dir}/cache_filsystem_usage_defaults"
-
-    if [ ! -r "$_fs_defaults_cache" ] ; then
-	# Determine filesystem for each database directory, generate
-	# an entry to warn at 90%, de-duplicate entries, put all items
-	# on 1 line (so the read below gets everything)
-	for _t in "${CTDB_DBDIR:-${CTDB_VARDIR}}" \
-		      "${CTDB_DBDIR_PERSISTENT:-${CTDB_VARDIR}/persistent}" \
-		      "${CTDB_DBDIR_STATE:-${CTDB_VARDIR}/state}" ; do
-	    df -kP "$_t" | awk 'NR == 2 { printf "%s:90\n", $6 }'
-	done | sort -u | xargs >"$_fs_defaults_cache"
-    fi
-
-    read CTDB_MONITOR_FILESYSTEM_USAGE <"$_fs_defaults_cache"
+	_fs_defaults_cache="${script_state_dir}/cache_filsystem_usage_defaults"
+
+	if [ ! -r "$_fs_defaults_cache" ]; then
+		# Determine filesystem for each database directory, generate
+		# an entry to warn at 90%, de-duplicate entries, put all items
+		# on 1 line (so the read below gets everything)
+		for _t in "${CTDB_DBDIR:-${CTDB_VARDIR}}" \
+			"${CTDB_DBDIR_PERSISTENT:-${CTDB_VARDIR}/persistent}" \
+			"${CTDB_DBDIR_STATE:-${CTDB_VARDIR}/state}"; do
+			df -kP "$_t" | awk 'NR == 2 { printf "%s:90\n", $6 }'
+		done | sort -u | xargs >"$_fs_defaults_cache"
+	fi
+
+	read -r CTDB_MONITOR_FILESYSTEM_USAGE <"$_fs_defaults_cache"
 }
 
-monitor_filesystem_usage ()
+monitor_filesystem_usage()
 {
-    if [ -z "$CTDB_MONITOR_FILESYSTEM_USAGE" ] ; then
-	set_monitor_filsystem_usage_defaults
-    fi
-
-    # Check each specified filesystem, specified in format
-    # <fs_mount>:<fs_warn_threshold>[:fs_unhealthy_threshold]
-    for _fs in $CTDB_MONITOR_FILESYSTEM_USAGE ; do
-	_fs_mount="${_fs%%:*}"
-	_fs_thresholds="${_fs#*:}"
-
-        if [ ! -d "$_fs_mount" ]; then
-            echo "WARNING: Directory ${_fs_mount} does not exist"
-	    continue
-        fi
-
-        # Get current utilization
-        _fs_usage=$(df -kP "$_fs_mount" | \
-			   sed -n -e 's at .*[[:space:]]\([[:digit:]]*\)%.*@\1 at p')
-        if [ -z "$_fs_usage" ] ; then
-            echo "WARNING: Unable to get FS utilization for ${_fs_mount}"
-	    continue
-        fi
-
-	check_thresholds "Filesystem ${_fs_mount}" \
-			 "$_fs_thresholds" \
-			 "$_fs_usage"
-    done
+	if [ -z "$CTDB_MONITOR_FILESYSTEM_USAGE" ]; then
+		set_monitor_filsystem_usage_defaults
+	fi
+
+	# Check each specified filesystem, specified in format
+	# <fs_mount>:<fs_warn_threshold>[:fs_unhealthy_threshold]
+	for _fs in $CTDB_MONITOR_FILESYSTEM_USAGE; do
+		_fs_mount="${_fs%%:*}"
+		_fs_thresholds="${_fs#*:}"
+
+		if [ ! -d "$_fs_mount" ]; then
+			echo "WARNING: Directory ${_fs_mount} does not exist"
+			continue
+		fi
+
+		# Get current utilization
+		_fs_usage=$(df -kP "$_fs_mount" |
+			sed -n -e 's at .*[[:space:]]\([[:digit:]]*\)%.*@\1 at p')
+		if [ -z "$_fs_usage" ]; then
+			printf 'WARNING: Unable to get FS utilization for %s\n' \
+			       "$_fs_mount"
+			continue
+		fi
+
+		check_thresholds "Filesystem ${_fs_mount}" \
+			"$_fs_thresholds" \
+			"$_fs_usage"
+	done
 }
 
-dump_memory_info ()
+dump_memory_info()
 {
-    get_proc "meminfo"
-    ps auxfww
-    set_proc "sysrq-trigger" "m"
+	get_proc "meminfo"
+	ps auxfww
+	set_proc "sysrq-trigger" "m"
 }
 
-monitor_memory_usage ()
+monitor_memory_usage()
 {
-    # Defaults
-    if [ -z "$CTDB_MONITOR_MEMORY_USAGE" ] ; then
-	CTDB_MONITOR_MEMORY_USAGE=80
-    fi
-
-    _meminfo=$(get_proc "meminfo")
-    # Intentional word splitting here
-    # shellcheck disable=SC2046
-    set -- $(echo "$_meminfo" | awk '
+	# Defaults
+	if [ -z "$CTDB_MONITOR_MEMORY_USAGE" ]; then
+		CTDB_MONITOR_MEMORY_USAGE=80
+	fi
+
+	_meminfo=$(get_proc "meminfo")
+	# Intentional word splitting here
+	# shellcheck disable=SC2046
+	set -- $(echo "$_meminfo" | awk '
 $1 == "MemAvailable:" { memavail += $2 }
 $1 == "MemFree:"      { memfree  += $2 }
 $1 == "Cached:"       { memfree  += $2 }
@@ -153,22 +173,23 @@ END {
 	print 0
     }
 }')
-    _mem_usage="$1"
+	_mem_usage="$1"
 
-    check_thresholds "System memory" \
-		     "$CTDB_MONITOR_MEMORY_USAGE" \
-		     "$_mem_usage" \
-		     dump_memory_info
+	check_thresholds "System memory" \
+		"$CTDB_MONITOR_MEMORY_USAGE" \
+		"$_mem_usage" \
+		dump_memory_info
 }
 
-
 case "$1" in
 monitor)
 	# Load/cache database options from configuration file
 	ctdb_get_db_options
 
-	monitor_filesystem_usage
-	monitor_memory_usage
+	rc=0
+	monitor_filesystem_usage || rc=$?
+	monitor_memory_usage || rc=$?
+	exit $rc
 	;;
 esac
 
diff --git a/ctdb/config/events/legacy/06.nfs.script b/ctdb/config/events/legacy/06.nfs.script
index 97086f78ed0..b937d433254 100755
--- a/ctdb/config/events/legacy/06.nfs.script
+++ b/ctdb/config/events/legacy/06.nfs.script
@@ -2,7 +2,7 @@
 # script to manage nfs in a clustered environment
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/10.interface.script b/ctdb/config/events/legacy/10.interface.script
index 8db6b5f42fe..7dfacd317d6 100755
--- a/ctdb/config/events/legacy/10.interface.script
+++ b/ctdb/config/events/legacy/10.interface.script
@@ -6,7 +6,7 @@
 # public interface
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/11.natgw.script b/ctdb/config/events/legacy/11.natgw.script
index b02ff7a6bf4..fb93dea6d5e 100755
--- a/ctdb/config/events/legacy/11.natgw.script
+++ b/ctdb/config/events/legacy/11.natgw.script
@@ -6,7 +6,7 @@
 #
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/11.routing.script b/ctdb/config/events/legacy/11.routing.script
index 3a526e1ed47..7ba7f3bf4a8 100755
--- a/ctdb/config/events/legacy/11.routing.script
+++ b/ctdb/config/events/legacy/11.routing.script
@@ -18,7 +18,7 @@
 # bond1 10.3.3.0/24 10.0.0.1
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/13.per_ip_routing.script b/ctdb/config/events/legacy/13.per_ip_routing.script
index ed5677327a1..e25647613bb 100755
--- a/ctdb/config/events/legacy/13.per_ip_routing.script
+++ b/ctdb/config/events/legacy/13.per_ip_routing.script
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/20.multipathd.script b/ctdb/config/events/legacy/20.multipathd.script
index ed6d5523a87..a420251d92c 100755
--- a/ctdb/config/events/legacy/20.multipathd.script
+++ b/ctdb/config/events/legacy/20.multipathd.script
@@ -7,7 +7,7 @@
 #
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/31.clamd.script b/ctdb/config/events/legacy/31.clamd.script
index 3b19923cc1b..5d60fe3aa37 100755
--- a/ctdb/config/events/legacy/31.clamd.script
+++ b/ctdb/config/events/legacy/31.clamd.script
@@ -2,7 +2,7 @@
 # event script to manage clamd in a cluster environment
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/40.vsftpd.script b/ctdb/config/events/legacy/40.vsftpd.script
index 69876d26dac..19d40071ce2 100755
--- a/ctdb/config/events/legacy/40.vsftpd.script
+++ b/ctdb/config/events/legacy/40.vsftpd.script
@@ -2,7 +2,7 @@
 # event strict to manage vsftpd in a cluster environment
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/41.httpd.script b/ctdb/config/events/legacy/41.httpd.script
index 3d67aee9028..dd90aeda274 100755
--- a/ctdb/config/events/legacy/41.httpd.script
+++ b/ctdb/config/events/legacy/41.httpd.script
@@ -2,7 +2,7 @@
 # event script to manage httpd in a cluster environment
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
 
 . "${CTDB_BASE}/functions"
 
diff --git a/ctdb/config/events/legacy/48.netbios.script b/ctdb/config/events/legacy/48.netbios.script
index d2cbf983b6a..43204476d6b 100755
--- a/ctdb/config/events/legacy/48.netbios.script
+++ b/ctdb/config/events/legacy/48.netbios.script
@@ -2,7 +2,7 @@
 # ctdb event script for Netbios Name Services
 
 [ -n "$CTDB_BASE" ] || \
-    CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+	CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")


-- 
Samba Shared Repository



More information about the samba-cvs mailing list