ctdb-scripts: Use load_script_options in event scripts
authorMartin Schwenke <martin@meltin.net>
Tue, 20 Feb 2018 01:56:42 +0000 (12:56 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 28 Mar 2018 00:57:21 +0000 (02:57 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
18 files changed:
ctdb/config/events.d/00.ctdb
ctdb/config/events.d/01.reclock
ctdb/config/events.d/05.system
ctdb/config/events.d/06.nfs
ctdb/config/events.d/10.interface
ctdb/config/events.d/11.natgw
ctdb/config/events.d/11.routing
ctdb/config/events.d/13.per_ip_routing
ctdb/config/events.d/20.multipathd
ctdb/config/events.d/31.clamd
ctdb/config/events.d/40.vsftpd
ctdb/config/events.d/41.httpd
ctdb/config/events.d/49.winbind
ctdb/config/events.d/50.samba
ctdb/config/events.d/60.nfs
ctdb/config/events.d/70.iscsi
ctdb/config/events.d/91.lvs
ctdb/config/events.d/99.timeout

index d60b9aa53c30bbf308c6862ef8f7db6782ec512e..ee8956758b257564f641dd7ab96662ad84b4938f 100755 (executable)
@@ -8,7 +8,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 ############################################################
 
index 44e49f44507b480bcebd5bef40da55b9c84bb7b4..e2e4c0da4b02b01866fb2f0eff5036c22d9866ca 100755 (executable)
@@ -6,7 +6,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "reclock"
 
index 41c582ea6d5fd3e94e804fe8d7ce2666810dad12..a902b22646ea0f6aa7b05c68e749e9eb16c28593 100755 (executable)
@@ -6,7 +6,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "system-monitoring"
 
index 81915aba9400d78c7a52e7f1dc6e692eb212c940..785188e5ecec234ecbaa68978a82bc9a5f89d0e5 100755 (executable)
@@ -8,7 +8,7 @@
 
 service_name="nfs"
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "$service_name"
 
index f05559b22ae643415919c739d6f7cfffa9d8cf01..28a7e5b11a391b81ee26059b290211283515d15e 100755 (executable)
@@ -10,7 +10,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 ctdb_public_addresses="${CTDB_BASE}/public_addresses"
 
index f2e17a7f9e99882c54a8bf528ac2c74ca585fafe..cf80d41c41e4a1b1926fc21438a2e3e5da7a3422 100755 (executable)
@@ -12,7 +12,7 @@
 
 service_name="natgw"
 
-loadconfig
+load_script_options
 
 [ -n "$CTDB_NATGW_NODES" ] || exit 0
 export CTDB_NATGW_NODES
index c8d875cd732cefe630954cdc2e85223d92fc3fd7..018ee5732a6e8bc98e66e44d074a5ec48e82b741 100755 (executable)
@@ -22,7 +22,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 [ -f "${CTDB_BASE}/static-routes" ] || {
     exit 0
index 2e080a1caff57dbb2188352b534a28ff2093c5bd..ae5a0b9186aae1ad77b7431305dcbe14a99ef351 100755 (executable)
@@ -5,7 +5,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 service_name="per_ip_routing"
 
index ac3453401d1cadcaa484012923a835ee30b26f04..ed6d5523a87ad9f122bfecdff599f0ca0d38f63a 100755 (executable)
@@ -13,7 +13,7 @@
 
 service_name="multipathd"
 
-loadconfig
+load_script_options
 
 [ -n "$CTDB_MONITOR_MPDEVICES" ] || exit 0
 
index 86d12a701343c8617a9649c3f5c31085ccd069b9..1049c3bdd47028b30b20f48e8f8f7ebaf2744104 100755 (executable)
@@ -23,7 +23,7 @@ redhat)
        ;;
 esac
 
-loadconfig
+load_script_options
 
 [ "$CTDB_MANAGES_CLAMD" = "yes" ] || exit 0
 
index 977bbc754ee4838096fc989404b70e750ff3dae5..c2e0eda5c1afa7183cb5d0d071a13a6e9cf04dc2 100755 (executable)
@@ -13,7 +13,7 @@ service_reconfigure ()
     service $service_name restart
 }
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "$service_name"
 
index 66f3ec53f74d4869f0b7955bd674e87d50570715..73b8d0fdd73a9342ebfe566ce62cb3b10f7d9440 100755 (executable)
@@ -23,6 +23,8 @@ suse|debian|*)
        ;;
 esac
 
+load_script_options
+
 ctdb_setup_state_dir "service" "$service_name"
 
 # RHEL5 sometimes use a SIGKILL to terminate httpd, which then leaks
@@ -47,8 +49,6 @@ service_stop ()
     killall -q -9 $service_name || true
 }
 
-loadconfig
-
 [ "$CTDB_MANAGES_HTTPD" = "yes" ] || exit 0
 
 case "$1" in
index d5f036da9ee2a83ffd0d87a15ea01992ee3a4a68..07d4c1c2b05ab58e3048b4cbcc76656515e0e3b9 100755 (executable)
@@ -12,7 +12,7 @@ CTDB_SERVICE_WINBIND=${CTDB_SERVICE_WINBIND:-winbind}
 # shellcheck disable=SC2034
 service_name="winbind"
 
-loadconfig
+load_script_options
 
 service_start ()
 {
index 286354fa7b8d1fe2b2309706045bf632929cb21a..784d62cd2ab44608ca9ac3edd32ca84ffb86b89c 100755 (executable)
@@ -26,7 +26,7 @@ esac
 
 service_name="samba"
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "$service_name"
 
index b4a7cd6a47166a9a67cb68ce97a9e23426f0ce2a..51d87269520c9e6e01e9db122863c4ee672578a4 100755 (executable)
@@ -10,7 +10,7 @@ service_name="nfs"
 
 load_system_config "nfs"
 
-loadconfig
+load_script_options
 
 ctdb_setup_state_dir "service" "$service_name"
 
index 8048be0d1baed2eeef80c98546272f07656a5aa6..670e0d79e8c2f0cc021ba7987eea12ca01d04dc7 100755 (executable)
@@ -11,7 +11,7 @@
 # shellcheck disable=SC2034
 service_name="iscsi"
 
-loadconfig
+load_script_options
 
 [ "$CTDB_MANAGES_ISCSI" = "yes" ] || exit 0
 
index f48be1160132ff45fd9cb91c43a04b700b24f143..c70f0c1315859c45aceafc77826660c7bd28a286 100755 (executable)
@@ -6,7 +6,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 [ -n "$CTDB_LVS_NODES" ] || exit 0
 export CTDB_LVS_NODES
index c2fe0913e1cc32d2ab883ee2265e1894c1f6eeba..71fe0b54a4487936a08120d3e03d447d3612821a 100755 (executable)
@@ -9,7 +9,7 @@
 
 . "${CTDB_BASE}/functions"
 
-loadconfig
+load_script_options
 
 [ "$CTDB_RUN_TIMEOUT_MONITOR" = "yes" ] || exit 0