From: Martin Schwenke Date: Tue, 6 Feb 2018 02:50:47 +0000 (+1100) Subject: ctdb-scripts: Move the reconfigure flag to the script state directory X-Git-Tag: talloc-2.1.12~226 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6aae12ba2b9218d8ca89b3b3c73905f9dba22b9;p=thirdparty%2Fsamba.git ctdb-scripts: Move the reconfigure flag to the script state directory Scripts that use these functions must call ctdb_setup_state_dir(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events.d/40.vsftpd index f3c4848b438..95de406e003 100755 --- a/ctdb/config/events.d/40.vsftpd +++ b/ctdb/config/events.d/40.vsftpd @@ -15,6 +15,8 @@ service_reconfigure () loadconfig +ctdb_setup_state_dir "service" "$service_name" + is_ctdb_managed_service || exit 0 case "$1" in diff --git a/ctdb/config/functions b/ctdb/config/functions index ae146111cdd..5070796a269 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -743,9 +743,11 @@ ctdb_setup_state_dir () _ctdb_service_reconfigure_common () { - _d="${CTDB_SCRIPT_VARDIR}/service_status/${service_name}" - mkdir -p "$_d" - _ctdb_service_reconfigure_flag="$_d/reconfigure" + if [ -z "$script_state_dir" ] ; then + die "ctdb_service_*_reconfigure() needs ctdb_setup_state_dir()" + fi + + _ctdb_service_reconfigure_flag="${script_state_dir}/need_reconfigure" } ctdb_service_needs_reconfigure ()