-This directory should contain executable programs to handle CTDB event
-notifications. The first and only argument passed to each program is
-the event, which is one of:
+This directory should contain executable programs ending in ".script"
+to handle CTDB event notifications. The first and only argument
+passed to each program is the event, which is one of:
init, setup, startup, unhealthy, healthy
mail -s "$(hostname) is HEALTHY" foo@example.com </dev/null >/dev/null 2>&1
;;
esac
-
-When adding programs please note the exclusion patterns in notify.sh.
#!/bin/sh
# This is script is invoked from ctdb when certain events happen. See
-# /etc/ctdb/notify.d/README for more details.
+# /etc/ctdb/events/notification/README for more details.
d=$(dirname "$0")
-nd="${d}/notify.d"
+nd="${d}/events/notification"
ok=true
-for i in "${nd}/"* ; do
- # Don't run files matching basename
- case "${i##*/}" in
- *~|*,|*.rpm*|*.swp|README) continue ;;
- esac
-
+for i in "${nd}/"*.script ; do
# Files must be executable
[ -x "$i" ] || continue
</para>
<para>
- The notification mechanism runs all executable files in
- <filename>/usr/local/etc/ctdb/notify.d/</filename>, ignoring any
- failures and continuing to run all files.
+ The notification mechanism runs all executable files ending in
+ ".script" in
+ <filename>/usr/local/etc/ctdb/events/notification/</filename>,
+ ignoring any failures and continuing to run all files.
</para>
<para>
install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
%endif
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/notify.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events/notification
# This is a hack. All documents should be installed in /usr/share/doc.
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
+cp config/notification.README README.notification
# Remove "*.old" files
find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
%config(noreplace) %{_sysconfdir}/ctdb/ctdb.tunables
%config(noreplace) %{_sysconfdir}/ctdb/script.options
%{_sysconfdir}/ctdb/notify.sh
-%dir %{_sysconfdir}/ctdb/notify.d
+%dir %{_sysconfdir}/ctdb/events/notification
%config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
%config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
%config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
%attr(755,root,root) %{initdir}/ctdb
%endif
-%attr(755,root,root) %{_sysconfdir}/ctdb/notify.d
-
%doc README COPYING
-%doc README.eventscripts README.notify.d
+%doc README.eventscripts README.notification
%doc doc/recovery-process.txt
%doc doc/cluster_mutex_helper.txt
%doc doc/*.html
bld.INSTALL_FILES('${SYSCONFDIR}/sudoers.d', 'ctdb.sudoers',
destname='ctdb')
- bld.INSTALL_FILES('${CTDB_ETCDIR}/notify.d', 'config/notify.d.README',
+ bld.INSTALL_FILES('${CTDB_ETCDIR}/events/notification',
+ 'config/notification.README',
destname='README')
bld.install_dir(bld.env.CTDB_LOGDIR)