]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Move event scripts to events/legacy/ directory
authorMartin Schwenke <martin@meltin.net>
Tue, 15 May 2018 03:39:15 +0000 (13:39 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 5 Jun 2018 15:47:26 +0000 (17:47 +0200)
This is the initial location that will be used by the new
multi-component aware event daemon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
30 files changed:
ctdb/.gitignore
ctdb/config/README
ctdb/config/events/README [moved from ctdb/config/events.d/README with 97% similarity]
ctdb/config/events/legacy/00.ctdb [moved from ctdb/config/events.d/00.ctdb with 100% similarity]
ctdb/config/events/legacy/01.reclock [moved from ctdb/config/events.d/01.reclock with 100% similarity]
ctdb/config/events/legacy/05.system [moved from ctdb/config/events.d/05.system with 100% similarity]
ctdb/config/events/legacy/06.nfs [moved from ctdb/config/events.d/06.nfs with 100% similarity]
ctdb/config/events/legacy/10.interface [moved from ctdb/config/events.d/10.interface with 100% similarity]
ctdb/config/events/legacy/11.natgw [moved from ctdb/config/events.d/11.natgw with 100% similarity]
ctdb/config/events/legacy/11.routing [moved from ctdb/config/events.d/11.routing with 100% similarity]
ctdb/config/events/legacy/13.per_ip_routing [moved from ctdb/config/events.d/13.per_ip_routing with 100% similarity]
ctdb/config/events/legacy/20.multipathd [moved from ctdb/config/events.d/20.multipathd with 100% similarity]
ctdb/config/events/legacy/31.clamd [moved from ctdb/config/events.d/31.clamd with 100% similarity]
ctdb/config/events/legacy/40.vsftpd [moved from ctdb/config/events.d/40.vsftpd with 100% similarity]
ctdb/config/events/legacy/41.httpd [moved from ctdb/config/events.d/41.httpd with 100% similarity]
ctdb/config/events/legacy/49.winbind [moved from ctdb/config/events.d/49.winbind with 100% similarity]
ctdb/config/events/legacy/50.samba [moved from ctdb/config/events.d/50.samba with 100% similarity]
ctdb/config/events/legacy/60.nfs [moved from ctdb/config/events.d/60.nfs with 100% similarity]
ctdb/config/events/legacy/70.iscsi [moved from ctdb/config/events.d/70.iscsi with 100% similarity]
ctdb/config/events/legacy/91.lvs [moved from ctdb/config/events.d/91.lvs with 100% similarity]
ctdb/config/events/legacy/99.timeout [moved from ctdb/config/events.d/99.timeout with 100% similarity]
ctdb/config/functions
ctdb/packaging/RPM/ctdb.spec.in
ctdb/server/ctdbd.c
ctdb/tests/complex/90_debug_hung_script.sh
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/shellcheck/event_scripts.sh
ctdb/tests/simple/etc-ctdb/events/legacy/00.test [moved from ctdb/tests/simple/etc-ctdb/events.d/00.test with 100% similarity]
ctdb/tests/simple/scripts/local_daemons.bash
ctdb/wscript

index 9e8c5812e9dd0601b263d0b13cf6cf33693ad867..a634aeb8b452145ffa816cd642bed7483dc0ad0b 100644 (file)
@@ -22,7 +22,6 @@ public_addresses.txt
 rec.lock
 test.db
 tests/bin
-tests/events.d/00.ctdb_test_trigger
 tests/var
 tests/takeover/ctdb_takeover.pyc
 tests/eventscripts/var
index ffbeb0e690bac81a0e3da0677349f20dad95cf60..d28f4f0fc600c8ae8d25747616de19b1bb708a0e 100644 (file)
@@ -6,9 +6,9 @@ Selected highlights:
 
     An initscript for starting ctdbd at boot time.
 
-  events.d/
+  events/
 
-    Eventscripts.  See events.d/README for more details.
+    Eventscripts.  See events/README for more details.
 
   functions
 
similarity index 97%
rename from ctdb/config/events.d/README
rename to ctdb/config/events/README
index f13714a7a2eddd82ce1e2f35fdfafb14fb4bec1f..88d5da45b6e8aef708b2abd677af32cd753bf8cb 100644 (file)
@@ -1,8 +1,11 @@
-The events.d/ directory contains event scripts used by CTDB.  Event
+The events/ directory contains event scripts used by CTDB.  Event
 scripts are triggered on certain events, such as startup, monitoring
 or public IP allocation.  Scripts may be specific to services,
 networking or internal CTDB operations.
 
+Scripts are divided into subdirectories for different CTDB components.
+Right now the only component is "legacy".
+
 All event scripts start with the prefix 'NN.' where N is a digit.  The
 event scripts are run in sequence based on NN.  Thus 10.interface will
 be run before 60.nfs.  It is recommended to keep each NN unique.
index 30afcdec9623eb23a27073756612cf48f33870cc..5cc995adf3fea7b6997560417383c4d252824c3b 100755 (executable)
@@ -64,7 +64,7 @@ load_script_options ()
        fi
 
        if [ -n "$_script" ] ; then
-               _s="${CTDB_BASE}/events.d/${_script}"
+               _s="${CTDB_BASE}/events/legacy/${_script}"
        else
                _s="${0%.script}"
        fi
index 55a0175a7745014197b73ff0b56e7257e8896ab2..40871d3d8f269a53eab0a3a8703a5b929b2752b9 100644 (file)
@@ -131,8 +131,8 @@ install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/notify.d
 
 # This is a hack. All documents should be installed in /usr/share/doc.
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events.d/README
-cp config/events.d/README README.eventscripts
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events/README
+cp config/events/README README.eventscripts
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/nfs-checks.d/README
 cp config/nfs-checks.d/README README.nfs-checks.d
 cp config/notify.d.README README.notify.d
@@ -179,8 +179,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/sudoers.d/ctdb
 %dir %{_sysconfdir}/ctdb
 %{_sysconfdir}/ctdb/functions
-%dir %{_sysconfdir}/ctdb/events.d
-%{_sysconfdir}/ctdb/events.d/*
+%dir %{_sysconfdir}/ctdb/events
+%{_sysconfdir}/ctdb/events/*
 %dir %{_sysconfdir}/ctdb/nfs-checks.d
 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/00.portmapper.check
 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/10.status.check
index 5290165a2a4694c2cec7a8775d79d8c84f366a16..93aedf2e4d97b9e329633058abf6bb39431b940d 100644 (file)
@@ -350,7 +350,7 @@ int main(int argc, const char *argv[])
        ctdb_tunables_set_defaults(ctdb);
 
        ctdb->event_script_dir = talloc_asprintf(ctdb,
-                                                "%s/events.d",
+                                                "%s/events/legacy",
                                                 ctdb_base);
        if (ctdb->event_script_dir == NULL) {
                DBG_ERR("Out of memory\n");
index b2518df6fdb34c209bfea2ee10f46a262a9c84e4..fc44bad8cb90dd006ecae3ee91ac71f9253b5c94 100755 (executable)
@@ -84,7 +84,7 @@ done <<'EOF'
 ===== Start of hung script debug for PID=".*", event="monitor" =====
 ===== End of hung script debug for PID=".*", event="monitor" =====
 pstree -p -a .*:
-99\\.timeout,.* /etc/ctdb/events.d/99.timeout monitor
+99\\.timeout,.* /etc/ctdb/events/legacy/99.timeout monitor
  *\`-sleep,.*
 ---- Stack trace of interesting process [0-9]*\\[sleep\\] ----
 [<[0-9a-f]*>] .*sleep+.*
index d34135eba35cf54a991bc6ccdd8c41924a69e48e..3f6bf16b5bc09a1dca7376ca5be1ef6a53fcce02 100644 (file)
@@ -40,7 +40,7 @@ else
 fi
 
 setup_ctdb_base "$EVENTSCRIPTS_TESTS_VAR_DIR" "etc-ctdb" \
-               events.d \
+               events \
                functions \
                nfs-checks.d \
                nfs-linux-kernel-callout \
@@ -85,7 +85,7 @@ setup_script_options ()
        fi
 
        if [ -n "$_script" ] ; then
-               _options="${CTDB_BASE}/events.d/${_script}.options"
+               _options="${CTDB_BASE}/events/legacy/${_script}.options"
        else
                _options="${script_dir}/${script%.script}.options"
        fi
@@ -458,12 +458,12 @@ define_test ()
        [0-9][0-9].*.*)
            script="${_f%.*}"
            event="${_f##*.}"
-           script_dir="${CTDB_BASE}/events.d"
+           script_dir="${CTDB_BASE}/events/legacy"
            ;;
        [0-9][0-9].*)
            script="$_f"
            unset event
-           script_dir="${CTDB_BASE}/events.d"
+           script_dir="${CTDB_BASE}/events/legacy"
            ;;
        *.*)
            script="${_f%.*}"
index b8a2b7844a3095bb00e5dd6cded078dfbb1100fb..b64c93649c8480b41b249eae331ba93cdd8b1fae 100755 (executable)
@@ -4,4 +4,4 @@
 
 define_test "event scripts"
 
-shellcheck_test "${CTDB_SCRIPTS_BASE}/events.d"/[0-9][0-9].*
+shellcheck_test "${CTDB_SCRIPTS_BASE}/events/"*/[0-9][0-9].*
index b3d0087888c7d3d59a6693a100b3eb473261e8a8..f681b18f6f1b6fd161decdc31b5e62a067d9ceb8 100644 (file)
@@ -137,7 +137,7 @@ setup_ctdb ()
                done
 
                if $no_event_scripts ; then
-                       rm -vf "${CTDB_BASE}/events.d/"*
+                       rm -vf "${CTDB_BASE}/events/legacy/"*
                fi
 
                cat >"${CTDB_BASE}/ctdb.conf" <<EOF
index 22f1b2677cd85bf012318b2a6a36cbdb4cb2890f..59c69aea4e6640f6f6704241c7ec703e5074cefa 100644 (file)
@@ -731,7 +731,7 @@ def build(bld):
         return pd['file_list']
 
     etc_subdirs = [
-        'events.d',
+        'events/legacy',
         'nfs-checks.d'
     ]