From: Martin Schwenke Date: Tue, 20 Feb 2018 01:56:42 +0000 (+1100) Subject: ctdb-scripts: Use load_script_options in event scripts X-Git-Tag: talloc-2.1.13~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65ce5e2129d7c4ba7b1728ef1df6dd424ed65b49;p=thirdparty%2Fsamba.git ctdb-scripts: Use load_script_options in event scripts Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb index d60b9aa53c3..ee8956758b2 100755 --- a/ctdb/config/events.d/00.ctdb +++ b/ctdb/config/events.d/00.ctdb @@ -8,7 +8,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options ############################################################ diff --git a/ctdb/config/events.d/01.reclock b/ctdb/config/events.d/01.reclock index 44e49f44507..e2e4c0da4b0 100755 --- a/ctdb/config/events.d/01.reclock +++ b/ctdb/config/events.d/01.reclock @@ -6,7 +6,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options ctdb_setup_state_dir "service" "reclock" diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system index 41c582ea6d5..a902b22646e 100755 --- a/ctdb/config/events.d/05.system +++ b/ctdb/config/events.d/05.system @@ -6,7 +6,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options ctdb_setup_state_dir "service" "system-monitoring" diff --git a/ctdb/config/events.d/06.nfs b/ctdb/config/events.d/06.nfs index 81915aba940..785188e5ece 100755 --- a/ctdb/config/events.d/06.nfs +++ b/ctdb/config/events.d/06.nfs @@ -8,7 +8,7 @@ service_name="nfs" -loadconfig +load_script_options ctdb_setup_state_dir "service" "$service_name" diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index f05559b22ae..28a7e5b11a3 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -10,7 +10,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options ctdb_public_addresses="${CTDB_BASE}/public_addresses" diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw index f2e17a7f9e9..cf80d41c41e 100755 --- a/ctdb/config/events.d/11.natgw +++ b/ctdb/config/events.d/11.natgw @@ -12,7 +12,7 @@ service_name="natgw" -loadconfig +load_script_options [ -n "$CTDB_NATGW_NODES" ] || exit 0 export CTDB_NATGW_NODES diff --git a/ctdb/config/events.d/11.routing b/ctdb/config/events.d/11.routing index c8d875cd732..018ee5732a6 100755 --- a/ctdb/config/events.d/11.routing +++ b/ctdb/config/events.d/11.routing @@ -22,7 +22,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options [ -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 2e080a1caff..ae5a0b9186a 100755 --- a/ctdb/config/events.d/13.per_ip_routing +++ b/ctdb/config/events.d/13.per_ip_routing @@ -5,7 +5,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options service_name="per_ip_routing" diff --git a/ctdb/config/events.d/20.multipathd b/ctdb/config/events.d/20.multipathd index ac3453401d1..ed6d5523a87 100755 --- a/ctdb/config/events.d/20.multipathd +++ b/ctdb/config/events.d/20.multipathd @@ -13,7 +13,7 @@ service_name="multipathd" -loadconfig +load_script_options [ -n "$CTDB_MONITOR_MPDEVICES" ] || exit 0 diff --git a/ctdb/config/events.d/31.clamd b/ctdb/config/events.d/31.clamd index 86d12a70134..1049c3bdd47 100755 --- a/ctdb/config/events.d/31.clamd +++ b/ctdb/config/events.d/31.clamd @@ -23,7 +23,7 @@ redhat) ;; esac -loadconfig +load_script_options [ "$CTDB_MANAGES_CLAMD" = "yes" ] || exit 0 diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events.d/40.vsftpd index 977bbc754ee..c2e0eda5c1a 100755 --- a/ctdb/config/events.d/40.vsftpd +++ b/ctdb/config/events.d/40.vsftpd @@ -13,7 +13,7 @@ service_reconfigure () service $service_name restart } -loadconfig +load_script_options ctdb_setup_state_dir "service" "$service_name" diff --git a/ctdb/config/events.d/41.httpd b/ctdb/config/events.d/41.httpd index 66f3ec53f74..73b8d0fdd73 100755 --- a/ctdb/config/events.d/41.httpd +++ b/ctdb/config/events.d/41.httpd @@ -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 diff --git a/ctdb/config/events.d/49.winbind b/ctdb/config/events.d/49.winbind index d5f036da9ee..07d4c1c2b05 100755 --- a/ctdb/config/events.d/49.winbind +++ b/ctdb/config/events.d/49.winbind @@ -12,7 +12,7 @@ CTDB_SERVICE_WINBIND=${CTDB_SERVICE_WINBIND:-winbind} # shellcheck disable=SC2034 service_name="winbind" -loadconfig +load_script_options service_start () { diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index 286354fa7b8..784d62cd2ab 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -26,7 +26,7 @@ esac service_name="samba" -loadconfig +load_script_options ctdb_setup_state_dir "service" "$service_name" diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index b4a7cd6a471..51d87269520 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -10,7 +10,7 @@ service_name="nfs" load_system_config "nfs" -loadconfig +load_script_options ctdb_setup_state_dir "service" "$service_name" diff --git a/ctdb/config/events.d/70.iscsi b/ctdb/config/events.d/70.iscsi index 8048be0d1ba..670e0d79e8c 100755 --- a/ctdb/config/events.d/70.iscsi +++ b/ctdb/config/events.d/70.iscsi @@ -11,7 +11,7 @@ # shellcheck disable=SC2034 service_name="iscsi" -loadconfig +load_script_options [ "$CTDB_MANAGES_ISCSI" = "yes" ] || exit 0 diff --git a/ctdb/config/events.d/91.lvs b/ctdb/config/events.d/91.lvs index f48be116013..c70f0c13158 100755 --- a/ctdb/config/events.d/91.lvs +++ b/ctdb/config/events.d/91.lvs @@ -6,7 +6,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options [ -n "$CTDB_LVS_NODES" ] || exit 0 export CTDB_LVS_NODES diff --git a/ctdb/config/events.d/99.timeout b/ctdb/config/events.d/99.timeout index c2fe0913e1c..71fe0b54a44 100755 --- a/ctdb/config/events.d/99.timeout +++ b/ctdb/config/events.d/99.timeout @@ -9,7 +9,7 @@ . "${CTDB_BASE}/functions" -loadconfig +load_script_options [ "$CTDB_RUN_TIMEOUT_MONITOR" = "yes" ] || exit 0