summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-05-15 13:39:15 +1000
committerAmitay Isaacs <amitay@samba.org>2018-06-05 17:47:26 +0200
commit12fd8d7a5c5d14d403aac6cd9e318afcd0a8e159 (patch)
tree216b7da2efee0c9bb4e89de2e1f05d9f18528704
parent0f5d93a0baa7ef5fc0ef2404dc9a3cc3438d0b7f (diff)
downloadsamba-12fd8d7a5c5d14d403aac6cd9e318afcd0a8e159.tar.gz
ctdb-scripts: Move event scripts to events/legacy/ directory
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>
-rw-r--r--ctdb/.gitignore1
-rw-r--r--ctdb/config/README4
-rw-r--r--ctdb/config/events/README (renamed from ctdb/config/events.d/README)5
-rwxr-xr-xctdb/config/events/legacy/00.ctdb (renamed from ctdb/config/events.d/00.ctdb)0
-rwxr-xr-xctdb/config/events/legacy/01.reclock (renamed from ctdb/config/events.d/01.reclock)0
-rwxr-xr-xctdb/config/events/legacy/05.system (renamed from ctdb/config/events.d/05.system)0
-rwxr-xr-xctdb/config/events/legacy/06.nfs (renamed from ctdb/config/events.d/06.nfs)0
-rwxr-xr-xctdb/config/events/legacy/10.interface (renamed from ctdb/config/events.d/10.interface)0
-rwxr-xr-xctdb/config/events/legacy/11.natgw (renamed from ctdb/config/events.d/11.natgw)0
-rwxr-xr-xctdb/config/events/legacy/11.routing (renamed from ctdb/config/events.d/11.routing)0
-rwxr-xr-xctdb/config/events/legacy/13.per_ip_routing (renamed from ctdb/config/events.d/13.per_ip_routing)0
-rwxr-xr-xctdb/config/events/legacy/20.multipathd (renamed from ctdb/config/events.d/20.multipathd)0
-rwxr-xr-xctdb/config/events/legacy/31.clamd (renamed from ctdb/config/events.d/31.clamd)0
-rwxr-xr-xctdb/config/events/legacy/40.vsftpd (renamed from ctdb/config/events.d/40.vsftpd)0
-rwxr-xr-xctdb/config/events/legacy/41.httpd (renamed from ctdb/config/events.d/41.httpd)0
-rwxr-xr-xctdb/config/events/legacy/49.winbind (renamed from ctdb/config/events.d/49.winbind)0
-rwxr-xr-xctdb/config/events/legacy/50.samba (renamed from ctdb/config/events.d/50.samba)0
-rwxr-xr-xctdb/config/events/legacy/60.nfs (renamed from ctdb/config/events.d/60.nfs)0
-rwxr-xr-xctdb/config/events/legacy/70.iscsi (renamed from ctdb/config/events.d/70.iscsi)0
-rwxr-xr-xctdb/config/events/legacy/91.lvs (renamed from ctdb/config/events.d/91.lvs)0
-rwxr-xr-xctdb/config/events/legacy/99.timeout (renamed from ctdb/config/events.d/99.timeout)0
-rwxr-xr-xctdb/config/functions2
-rw-r--r--ctdb/packaging/RPM/ctdb.spec.in8
-rw-r--r--ctdb/server/ctdbd.c2
-rwxr-xr-xctdb/tests/complex/90_debug_hung_script.sh2
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh8
-rwxr-xr-xctdb/tests/shellcheck/event_scripts.sh2
-rwxr-xr-xctdb/tests/simple/etc-ctdb/events/legacy/00.test (renamed from ctdb/tests/simple/etc-ctdb/events.d/00.test)0
-rw-r--r--ctdb/tests/simple/scripts/local_daemons.bash2
-rw-r--r--ctdb/wscript2
30 files changed, 20 insertions, 18 deletions
diff --git a/ctdb/.gitignore b/ctdb/.gitignore
index 9e8c5812e9d..a634aeb8b45 100644
--- a/ctdb/.gitignore
+++ b/ctdb/.gitignore
@@ -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
diff --git a/ctdb/config/README b/ctdb/config/README
index ffbeb0e690b..d28f4f0fc60 100644
--- a/ctdb/config/README
+++ b/ctdb/config/README
@@ -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
diff --git a/ctdb/config/events.d/README b/ctdb/config/events/README
index f13714a7a2e..88d5da45b6e 100644
--- a/ctdb/config/events.d/README
+++ b/ctdb/config/events/README
@@ -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.
diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events/legacy/00.ctdb
index 8db4a19d184..8db4a19d184 100755
--- a/ctdb/config/events.d/00.ctdb
+++ b/ctdb/config/events/legacy/00.ctdb
diff --git a/ctdb/config/events.d/01.reclock b/ctdb/config/events/legacy/01.reclock
index e14d8c22f48..e14d8c22f48 100755
--- a/ctdb/config/events.d/01.reclock
+++ b/ctdb/config/events/legacy/01.reclock
diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events/legacy/05.system
index e2ffeac715a..e2ffeac715a 100755
--- a/ctdb/config/events.d/05.system
+++ b/ctdb/config/events/legacy/05.system
diff --git a/ctdb/config/events.d/06.nfs b/ctdb/config/events/legacy/06.nfs
index 4e029065ab0..4e029065ab0 100755
--- a/ctdb/config/events.d/06.nfs
+++ b/ctdb/config/events/legacy/06.nfs
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events/legacy/10.interface
index 72e0c101d47..72e0c101d47 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events/legacy/10.interface
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events/legacy/11.natgw
index 18b064a1efb..18b064a1efb 100755
--- a/ctdb/config/events.d/11.natgw
+++ b/ctdb/config/events/legacy/11.natgw
diff --git a/ctdb/config/events.d/11.routing b/ctdb/config/events/legacy/11.routing
index 018ee5732a6..018ee5732a6 100755
--- a/ctdb/config/events.d/11.routing
+++ b/ctdb/config/events/legacy/11.routing
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events/legacy/13.per_ip_routing
index 269829483ab..269829483ab 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events/legacy/13.per_ip_routing
diff --git a/ctdb/config/events.d/20.multipathd b/ctdb/config/events/legacy/20.multipathd
index ed6d5523a87..ed6d5523a87 100755
--- a/ctdb/config/events.d/20.multipathd
+++ b/ctdb/config/events/legacy/20.multipathd
diff --git a/ctdb/config/events.d/31.clamd b/ctdb/config/events/legacy/31.clamd
index e073608e995..e073608e995 100755
--- a/ctdb/config/events.d/31.clamd
+++ b/ctdb/config/events/legacy/31.clamd
diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events/legacy/40.vsftpd
index c2e0eda5c1a..c2e0eda5c1a 100755
--- a/ctdb/config/events.d/40.vsftpd
+++ b/ctdb/config/events/legacy/40.vsftpd
diff --git a/ctdb/config/events.d/41.httpd b/ctdb/config/events/legacy/41.httpd
index 4030d7cc3bb..4030d7cc3bb 100755
--- a/ctdb/config/events.d/41.httpd
+++ b/ctdb/config/events/legacy/41.httpd
diff --git a/ctdb/config/events.d/49.winbind b/ctdb/config/events/legacy/49.winbind
index 07d4c1c2b05..07d4c1c2b05 100755
--- a/ctdb/config/events.d/49.winbind
+++ b/ctdb/config/events/legacy/49.winbind
diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events/legacy/50.samba
index f65f53a15db..f65f53a15db 100755
--- a/ctdb/config/events.d/50.samba
+++ b/ctdb/config/events/legacy/50.samba
diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events/legacy/60.nfs
index 51d87269520..51d87269520 100755
--- a/ctdb/config/events.d/60.nfs
+++ b/ctdb/config/events/legacy/60.nfs
diff --git a/ctdb/config/events.d/70.iscsi b/ctdb/config/events/legacy/70.iscsi
index 670e0d79e8c..670e0d79e8c 100755
--- a/ctdb/config/events.d/70.iscsi
+++ b/ctdb/config/events/legacy/70.iscsi
diff --git a/ctdb/config/events.d/91.lvs b/ctdb/config/events/legacy/91.lvs
index b3d65f44607..b3d65f44607 100755
--- a/ctdb/config/events.d/91.lvs
+++ b/ctdb/config/events/legacy/91.lvs
diff --git a/ctdb/config/events.d/99.timeout b/ctdb/config/events/legacy/99.timeout
index 71fe0b54a44..71fe0b54a44 100755
--- a/ctdb/config/events.d/99.timeout
+++ b/ctdb/config/events/legacy/99.timeout
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 30afcdec962..5cc995adf3f 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -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
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
index 55a0175a774..40871d3d8f2 100644
--- a/ctdb/packaging/RPM/ctdb.spec.in
+++ b/ctdb/packaging/RPM/ctdb.spec.in
@@ -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
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index 5290165a2a4..93aedf2e4d9 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -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");
diff --git a/ctdb/tests/complex/90_debug_hung_script.sh b/ctdb/tests/complex/90_debug_hung_script.sh
index b2518df6fdb..fc44bad8cb9 100755
--- a/ctdb/tests/complex/90_debug_hung_script.sh
+++ b/ctdb/tests/complex/90_debug_hung_script.sh
@@ -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+.*
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index d34135eba35..3f6bf16b5bc 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -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%.*}"
diff --git a/ctdb/tests/shellcheck/event_scripts.sh b/ctdb/tests/shellcheck/event_scripts.sh
index b8a2b7844a3..b64c93649c8 100755
--- a/ctdb/tests/shellcheck/event_scripts.sh
+++ b/ctdb/tests/shellcheck/event_scripts.sh
@@ -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].*
diff --git a/ctdb/tests/simple/etc-ctdb/events.d/00.test b/ctdb/tests/simple/etc-ctdb/events/legacy/00.test
index 0ae09879d43..0ae09879d43 100755
--- a/ctdb/tests/simple/etc-ctdb/events.d/00.test
+++ b/ctdb/tests/simple/etc-ctdb/events/legacy/00.test
diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash
index b3d0087888c..f681b18f6f1 100644
--- a/ctdb/tests/simple/scripts/local_daemons.bash
+++ b/ctdb/tests/simple/scripts/local_daemons.bash
@@ -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
diff --git a/ctdb/wscript b/ctdb/wscript
index 22f1b2677cd..59c69aea4e6 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -731,7 +731,7 @@ def build(bld):
return pd['file_list']
etc_subdirs = [
- 'events.d',
+ 'events/legacy',
'nfs-checks.d'
]