[SCM] Samba Shared Repository - branch master updated
Amitay Isaacs
amitay at samba.org
Wed Jul 6 06:16:03 UTC 2016
The branch, master has been updated
via 9ec9e6f ctdb-scripts: Quote some variable expansions
via 85b1cbb ctdb-scripts: Fix incorrect variable reference
via 15ed9ad ctdb-scripts: Use globs instead of ls to list files
via c7ed73a ctdb-scripts: Fix incorrect variable reference
via eabeecb ctdb-scripts: Fix incorrect variable reference
via f227c26 ctdb-scripts: Update script boilerplate to avoid shellcheck warnings
via 850863a ctdb-scripts: Export CTDB_BASE in functions file
via aa5b6f6 ctdb-scripts: Drop optional argument to nfs_check_services()
from 20319ba gensec: Change log level for message when obtaining PAC from gss_get_name_attribute failed
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9ec9e6f77ba0dcb9af169d90879e4e78e4b65812
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 18:11:44 2016 +1000
ctdb-scripts: Quote some variable expansions
This avoids relevant shellcheck warnings. This is most of the
shellcheck low hanging fruit in the non-test code. Many of the other
warnings produced by shellcheck are either false positives, are
non-trivial to fix or a fix may result in worse code.
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): Wed Jul 6 08:15:49 CEST 2016 on sn-devel-144
commit 85b1cbb0449bb62ff9a8e93eec584ea9fee1052c
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 20:43:18 2016 +1000
ctdb-scripts: Fix incorrect variable reference
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 15ed9ad035dd2b4e40c1ce00fe420a6367ef27f1
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:54:00 2016 +1000
ctdb-scripts: Use globs instead of ls to list files
shellcheck reports that using ls is fragile.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit c7ed73a617199125a64c16f470accc11e8338335
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:49:13 2016 +1000
ctdb-scripts: Fix incorrect variable reference
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit eabeecb45322747d7daeb2a79ac213f17eb049da
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:47:12 2016 +1000
ctdb-scripts: Fix incorrect variable reference
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit f227c26178c2eaf3fae49f32a90ec905f85005f4
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:36:05 2016 +1000
ctdb-scripts: Update script boilerplate to avoid shellcheck warnings
* Assign the output of dirname to temporary variable to avoid word
splitting when directory name contains whitespace
* Drop export of CTDB_BASE to avoid masking broken return value -
functions file does the export anyway
* Quote path when including functions file
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 850863a15ef462b4df53d5bdad3c80dbaf569089
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:33:43 2016 +1000
ctdb-scripts: Export CTDB_BASE in functions file
This avoids having to export it in every file that includes the
functions file.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit aa5b6f6e9f5b1d4b238b0b721c065bcf4261a8a1
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jun 29 17:05:17 2016 +1000
ctdb-scripts: Drop optional argument to nfs_check_services()
Added so that nfs_check_services() could be run against an arbirary
directory. However, with the function moved to the event script, this
isn't useful. CTDB_NFS_CHECKS_DIR can be used for testing instead.
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 | 4 +--
ctdb/config/ctdbd_wrapper | 3 +-
ctdb/config/debug-hung-script.sh | 6 ++--
ctdb/config/debug_locks.sh | 12 ++++----
ctdb/config/events.d/00.ctdb | 24 +++++++--------
ctdb/config/events.d/01.reclock | 7 +++--
ctdb/config/events.d/05.system | 7 +++--
ctdb/config/events.d/06.nfs | 4 +--
ctdb/config/events.d/10.external | 5 ++--
ctdb/config/events.d/10.interface | 25 +++++++++-------
ctdb/config/events.d/11.natgw | 20 ++++++-------
ctdb/config/events.d/11.routing | 7 +++--
ctdb/config/events.d/13.per_ip_routing | 7 +++--
ctdb/config/events.d/20.multipathd | 6 ++--
ctdb/config/events.d/31.clamd | 4 +--
ctdb/config/events.d/40.vsftpd | 4 +--
ctdb/config/events.d/41.httpd | 4 +--
ctdb/config/events.d/49.winbind | 4 +--
ctdb/config/events.d/50.samba | 8 ++---
ctdb/config/events.d/60.nfs | 16 +++++-----
ctdb/config/events.d/70.iscsi | 6 ++--
ctdb/config/events.d/91.lvs | 8 ++---
ctdb/config/events.d/99.timeout | 5 ++--
ctdb/config/functions | 53 +++++++++++++++++-----------------
ctdb/config/nfs-linux-kernel-callout | 2 +-
ctdb/config/notify.sh | 2 +-
ctdb/config/statd-callout | 22 ++++++++------
27 files changed, 145 insertions(+), 130 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/config/ctdb-crash-cleanup.sh b/ctdb/config/ctdb-crash-cleanup.sh
index 78eaa93..bcecbfe 100755
--- a/ctdb/config/ctdb-crash-cleanup.sh
+++ b/ctdb/config/ctdb-crash-cleanup.sh
@@ -5,9 +5,9 @@
#
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. "$CTDB_BASE/functions"
+. "${CTDB_BASE}/functions"
# If ctdb is running, just exit
if service ctdb status >/dev/null 2>&1 ; then
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index c007409..caeb81a 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -214,7 +214,8 @@ start()
ulimit -n $CTDB_MAX_OPEN_FILES
fi
- mkdir -p $(dirname "$pidfile")
+ _d=$(dirname "$pidfile")
+ mkdir -p "$_d"
if [ -n "$CTDB_VALGRIND" -a "$CTDB_VALGRIND" != "no" ] ; then
if [ "$CTDB_VALGRIND" = "yes" ] ; then
diff --git a/ctdb/config/debug-hung-script.sh b/ctdb/config/debug-hung-script.sh
index cef004b..cdf1657 100755
--- a/ctdb/config/debug-hung-script.sh
+++ b/ctdb/config/debug-hung-script.sh
@@ -4,9 +4,9 @@
# for other operating systems.
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. "$CTDB_BASE/functions"
+. "${CTDB_BASE}/functions"
loadconfig ctdb
@@ -25,7 +25,7 @@ fi
echo "===== Start of hung script debug for PID=\"$1\", event=\"$2\" ====="
echo "pstree -p -a ${1}:"
- out=$(pstree -p -a $1)
+ out=$(pstree -p -a "$1")
echo "$out"
# Check for processes matching a regular expression and print
diff --git a/ctdb/config/debug_locks.sh b/ctdb/config/debug_locks.sh
index 8e33751..62b6799 100755
--- a/ctdb/config/debug_locks.sh
+++ b/ctdb/config/debug_locks.sh
@@ -8,9 +8,9 @@
# rather than mutex locks.
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. "$CTDB_BASE/functions"
+. "${CTDB_BASE}/functions"
# Default fallback location for database directories.
# These can be overwritten from CTDB configuration
@@ -36,7 +36,7 @@ loadconfig ctdb
grep -F "POSIX ADVISORY WRITE" |
awk '{ if($2 == "->") { print $6, $7, $8, $9, "W" } else { print $5, $6, $7, $8 } }' |
while read pid rest ; do
- pname=$(readlink /proc/$pid/exe)
+ pname=$(readlink "/proc/${pid}/exe")
echo $pid $pname $rest
done | sed -e "$sed_cmd" | grep "\.tdb" )
@@ -56,7 +56,7 @@ loadconfig ctdb
# For each process waiting, log stack trace
for pid in $pids ; do
echo "----- Stack trace for PID=$pid -----"
- read x x state x </proc/$pid/stat
+ read x x state x <"/proc/${pid}/stat"
if [ "$state" = "D" ] ; then
# Don't run gstack on a process in D state since
# gstack will hang until the process exits D state.
@@ -68,9 +68,9 @@ loadconfig ctdb
# deadlock... but it will probably give us someone to
# blame!
echo "----- Process in D state, printing kernel stack only"
- cat /proc/$pid/stack
+ cat "/proc/${pid}/stack"
else
- gstack $pid
+ gstack "$pid"
# gcore -o /var/log/core-deadlock-ctdb $pid
fi
done
diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb
index bb150ac..d7b238f 100755
--- a/ctdb/config/events.d/00.ctdb
+++ b/ctdb/config/events.d/00.ctdb
@@ -4,9 +4,10 @@
# elsewhere.
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
ctdb_setup_service_state_dir "ctdb"
@@ -69,11 +70,10 @@ check_persistent_databases ()
[ "${CTDB_MAX_PERSISTENT_CHECK_ERRORS:-0}" = "0" ] || return 0
- for _db in $(ls "$_dir/"*.tdb.*[0-9] 2>/dev/null) ; do
- check_tdb $_db || {
- echo "Persistent database $_db is corrupted! CTDB will not start."
- return 1
- }
+ for _db in "$_dir/"*.tdb.*[0-9] ; do
+ [ -r "$_db" ] || continue
+ check_tdb "$_db" || \
+ die "Persistent database $_db is corrupted! CTDB will not start."
done
}
@@ -82,8 +82,9 @@ check_non_persistent_databases ()
_dir="${CTDB_DBDIR:-${CTDB_VARDIR}}"
[ -d "$_dir" ] || return 0
- for _db in $(ls "${_dir}/"*.tdb.*[0-9] 2>/dev/null) ; do
- check_tdb $_db || {
+ for _db in "${_dir}/"*.tdb.*[0-9] ; do
+ [ -r "$_db" ] || continue
+ check_tdb "$_db" || {
_backup="${_db}.$(date +'%Y%m%d.%H%M%S.%N').corrupt"
cat <<EOF
WARNING: database ${_db} is corrupted.
@@ -95,7 +96,6 @@ EOF
ls -td "${_db}."*".corrupt" |
tail -n +$((${CTDB_MAX_CORRUPT_DB_BACKUPS:-10} + 1)) |
xargs rm -f
-
}
done
}
@@ -107,7 +107,7 @@ set_ctdb_variables ()
while read v; do
varname="${v#CTDB_SET_}"
value=$(eval echo "\$$v")
- if $CTDB setvar $varname $value ; then
+ if $CTDB setvar "$varname" "$value" ; then
echo "Set $varname to $value"
else
echo "Invalid configuration: CTDB_SET_${varname}=${value}"
@@ -125,7 +125,7 @@ case "$1" in
# make sure we have a blank state directory for the scripts to work with
rm -rf "$CTDB_SCRIPT_VARDIR"
mkdir -p "$CTDB_SCRIPT_VARDIR" || \
- die "mkdir -p ${CTDB_SCRIPT_VARDIR} - failed - ${ret}" $?
+ die "mkdir -p ${CTDB_SCRIPT_VARDIR} - failed - $?" $?
if select_tdb_checker ; then
check_persistent_databases || exit $?
diff --git a/ctdb/config/events.d/01.reclock b/ctdb/config/events.d/01.reclock
index da37cf8..52e65b9 100755
--- a/ctdb/config/events.d/01.reclock
+++ b/ctdb/config/events.d/01.reclock
@@ -2,9 +2,10 @@
# script to check accessibility to the reclock file on a node
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
# If CTDB_RECOVERY_LOCK specifies a helper then exit because this
@@ -30,7 +31,7 @@ case "$1" in
# Try to stat the reclock file as a background process so that
# we don't block in case the cluster filesystem is unavailable
(
- if stat $CTDB_RECOVERY_LOCK ; then
+ if stat "$CTDB_RECOVERY_LOCK" ; then
# We could stat the file, reset the counter
ctdb_counter_init
fi
diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system
index bfa8e7b..2dbfca5 100755
--- a/ctdb/config/events.d/05.system
+++ b/ctdb/config/events.d/05.system
@@ -2,9 +2,10 @@
# ctdb event script for checking local file system utilization
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
ctdb_setup_service_state_dir "system-monitoring"
@@ -47,7 +48,7 @@ check_thresholds ()
fi
fi
- if validate_percentage "$_warn_threshold" "$_what" ; then
+ if validate_percentage "$_warn_threshold" "$_thing" ; then
if [ "$_usage" -ge "$_warn_threshold" ] ; then
if [ -r "$_cache" ] ; then
read _prev <"$_cache"
diff --git a/ctdb/config/events.d/06.nfs b/ctdb/config/events.d/06.nfs
index 2a069f3..d0611a5 100755
--- a/ctdb/config/events.d/06.nfs
+++ b/ctdb/config/events.d/06.nfs
@@ -2,9 +2,9 @@
# script to manage nfs in a clustered environment
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. $CTDB_BASE/functions
+. "${CTDB_BASE}/functions"
service_name="nfs"
loadconfig
diff --git a/ctdb/config/events.d/10.external b/ctdb/config/events.d/10.external
index 40f4680..4b22dc7 100644
--- a/ctdb/config/events.d/10.external
+++ b/ctdb/config/events.d/10.external
@@ -8,9 +8,10 @@
# * For connection tracking/killing to work this script must be enabled.
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
if [ -z "$CTDB_PUBLIC_ADDRESSES" ] ; then
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 204f4c6..9b9a8cd 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -6,13 +6,14 @@
# public interface
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
[ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
- CTDB_PUBLIC_ADDRESSES=$CTDB_BASE/public_addresses
+ CTDB_PUBLIC_ADDRESSES="${CTDB_BASE}/public_addresses"
}
[ ! -f "$CTDB_PUBLIC_ADDRESSES" ] && {
@@ -26,7 +27,9 @@ loadconfig
get_all_interfaces ()
{
# Get all the interfaces listed in the public_addresses file
- all_interfaces=$(sed -e "s/^[^\t ]*[\t ]*//" -e "s/,/ /g" -e "s/[\t ]*$//" $CTDB_PUBLIC_ADDRESSES)
+ all_interfaces=$(sed -e "s/^[^\t ]*[\t ]*//" \
+ -e "s/,/ /g" \
+ -e "s/[\t ]*$//" "$CTDB_PUBLIC_ADDRESSES")
# Add some special interfaces if they're defined
[ "$CTDB_PUBLIC_INTERFACE" ] && all_interfaces="$CTDB_PUBLIC_INTERFACE $all_interfaces"
@@ -160,7 +163,7 @@ case "$1" in
ip=$3
maskbits=$4
- add_ip_to_iface $iface $ip $maskbits || {
+ add_ip_to_iface "$iface" "$ip" "$maskbits" || {
exit 1;
}
@@ -188,7 +191,7 @@ case "$1" in
kill_tcp_connections "$iface" "$ip"
- delete_ip_from_iface $iface $ip $maskbits || {
+ delete_ip_from_iface "$iface" "$ip" "$maskbits" || {
ip_unblock "$ip" "$iface"
exit 1
}
@@ -220,10 +223,10 @@ case "$1" in
ip_block "$ip" "$oiface"
- delete_ip_from_iface $oiface $ip $maskbits 2>/dev/null
- delete_ip_from_iface $niface $ip $maskbits 2>/dev/null
+ delete_ip_from_iface "$oiface" "$ip" "$maskbits" 2>/dev/null
+ delete_ip_from_iface "$niface" "$ip" "$maskbits" 2>/dev/null
- add_ip_to_iface $niface $ip $maskbits || {
+ add_ip_to_iface "$niface" "$ip" "$maskbits" || {
ip_unblock "$ip" "$oiface"
exit 1
}
@@ -233,11 +236,11 @@ case "$1" in
flush_route_cache
# propagate the new mac address
- $CTDB gratiousarp $ip $niface
+ $CTDB gratiousarp "$ip" "$niface"
# tickle all existing connections, so that dropped packets
# are retransmited and the tcp streams work
- tickle_tcp_connections $ip
+ tickle_tcp_connections "$ip"
;;
monitor)
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw
index d6f8161..04eea81 100755
--- a/ctdb/config/events.d/11.natgw
+++ b/ctdb/config/events.d/11.natgw
@@ -6,9 +6,9 @@
#
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. $CTDB_BASE/functions
+. "${CTDB_BASE}/functions"
service_name=natgw
@@ -91,7 +91,7 @@ _natgw_clear ()
_maskbits="${CTDB_NATGW_PUBLIC_IP#*/}"
delete_ip_from_iface \
- $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits >/dev/null 2>&1
+ "$CTDB_NATGW_PUBLIC_IFACE" "$_ip" "$_maskbits" >/dev/null 2>&1
for _net_gw in $CTDB_NATGW_STATIC_ROUTES ; do
_net="${_net_gw%@*}"
ip route del "$_net" metric 10 >/dev/null 2>/dev/null
@@ -100,16 +100,16 @@ _natgw_clear ()
# Delete the masquerading setup from a previous iteration where we
# were the NAT-GW
iptables -D POSTROUTING -t nat \
- -s $CTDB_NATGW_PRIVATE_NETWORK ! -d $CTDB_NATGW_PRIVATE_NETWORK \
+ -s "$CTDB_NATGW_PRIVATE_NETWORK" ! -d "$CTDB_NATGW_PRIVATE_NETWORK" \
-j MASQUERADE >/dev/null 2>/dev/null
- iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null
+ iptables -D INPUT -p tcp --syn -d "${_ip}/32" -j REJECT 2>/dev/null
}
natgw_clear ()
{
if [ -r "$natgw_cfg_old" ] ; then
- (. $natgw_cfg_old ; _natgw_clear)
+ (. "$natgw_cfg_old" ; _natgw_clear)
else
_natgw_clear
fi
@@ -119,17 +119,17 @@ natgw_set_master ()
{
set_proc sys/net/ipv4/ip_forward 1
iptables -A POSTROUTING -t nat \
- -s $CTDB_NATGW_PRIVATE_NETWORK ! -d $CTDB_NATGW_PRIVATE_NETWORK \
+ -s "$CTDB_NATGW_PRIVATE_NETWORK" ! -d "$CTDB_NATGW_PRIVATE_NETWORK" \
-j MASQUERADE
# block all incoming connections to the NATGW IP address
ctdb_natgw_public_ip_host="${CTDB_NATGW_PUBLIC_IP%/*}/32"
iptables -D INPUT -p tcp --syn \
- -d $ctdb_natgw_public_ip_host -j REJECT 2>/dev/null
+ -d "$ctdb_natgw_public_ip_host" -j REJECT 2>/dev/null
iptables -I INPUT -p tcp --syn \
- -d $ctdb_natgw_public_ip_host -j REJECT 2>/dev/null
+ -d "$ctdb_natgw_public_ip_host" -j REJECT 2>/dev/null
- ip addr add $CTDB_NATGW_PUBLIC_IP dev $CTDB_NATGW_PUBLIC_IFACE
+ ip addr add "$CTDB_NATGW_PUBLIC_IP" dev "$CTDB_NATGW_PUBLIC_IFACE"
for _net_gw in $CTDB_NATGW_STATIC_ROUTES ; do
_net="${_net_gw%@*}"
if [ "$_net" != "$_net_gw" ] ; then
diff --git a/ctdb/config/events.d/11.routing b/ctdb/config/events.d/11.routing
index 2fe560f..87c0027 100755
--- a/ctdb/config/events.d/11.routing
+++ b/ctdb/config/events.d/11.routing
@@ -18,12 +18,13 @@
# bond1 10.3.3.0/24 10.0.0.1
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
-[ -f $CTDB_BASE/static-routes ] || {
+[ -f "${CTDB_BASE}/static-routes" ] || {
exit 0
}
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing
index cfcd484..20f9085 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events.d/13.per_ip_routing
@@ -1,9 +1,10 @@
#!/bin/sh
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
+
+. "${CTDB_BASE}/functions"
-. $CTDB_BASE/functions
loadconfig
service_name=per_ip_routing
@@ -266,7 +267,7 @@ EOF
# is invalid. Therefore, go to a little bit of trouble to indent
# the failure message so that it is associated with the above
# warning message and doesn't look too nasty.
- ip route flush table $_table_id 2>&1 | sed -e 's@^.@ &@'
+ ip route flush table "$_table_id" 2>&1 | sed -e 's@^.@ &@'
}
######################################################################
diff --git a/ctdb/config/events.d/20.multipathd b/ctdb/config/events.d/20.multipathd
index 64748da..b5f71e5 100755
--- a/ctdb/config/events.d/20.multipathd
+++ b/ctdb/config/events.d/20.multipathd
@@ -7,13 +7,13 @@
#
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. $CTDB_BASE/functions
+. "${CTDB_BASE}/functions"
service_name="multipathd"
-loadconfig
+loadconfig
[ -n "$CTDB_MONITOR_MPDEVICES" ] || exit 0
diff --git a/ctdb/config/events.d/31.clamd b/ctdb/config/events.d/31.clamd
index 15751a9..2e5eefe 100755
--- a/ctdb/config/events.d/31.clamd
+++ b/ctdb/config/events.d/31.clamd
@@ -2,9 +2,9 @@
# event script to manage clamd in a cluster environment
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. $CTDB_BASE/functions
+. "${CTDB_BASE}/functions"
detect_init_style
diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events.d/40.vsftpd
index 92a0e99..c1f193b 100755
--- a/ctdb/config/events.d/40.vsftpd
+++ b/ctdb/config/events.d/40.vsftpd
@@ -2,9 +2,9 @@
# event strict to manage vsftpd in a cluster environment
[ -n "$CTDB_BASE" ] || \
- export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
+ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
-. $CTDB_BASE/functions
+. "${CTDB_BASE}/functions"
--
Samba Shared Repository
More information about the samba-cvs
mailing list