$ ctdb/tests/local_daemons.sh foo onnode 0 ctdb event script list legacy
Unable to find event script installation directory: foo/node.0/share/events/legacy
This happens if the $CTDB_BASE/share/events/legacy/ directory does not
exist. This directory is (theoretically) for installed but not
necessarily enabled event scripts. ctdb/tests/etc-ctdb/ contains
events/legacy/ but setup_ctdb_base() currently does not ensure
creation of the corresponding directory under $CTDB_BASE/share/.
Ensure that an event script component installation subdirectory exists
for each corresponding configuration subdirectory.
An alternative would be to continue to allow the existing failure, but
create directory ctdb/tests/etc-ctdb/share/events/legacy/ specifically
to make local_daemons.sh work. However, it took 5 years to find the
current bug, so this may be too subtle for other users of
local_daemons.sh. Anyone wanting to test the failure case can remove
unwanted subdirectories after "local_daemons.sh setup".
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
[ -e "$_i" ] || break
cp -pr "$_i" "${CTDB_BASE}/"
+
+ done
+
+ # Ensure existence of an event script component installation
+ # subdirectory corresponding to each event script component
+ # configuration subdirectory.
+ #
+ # This helps:
+ # local_daemons.sh <dir> onnode <n> ctdb event script list <component>
+ # to work.
+ for _d in "${CTDB_BASE}/events/"*; do
+ _b=$(basename "$_d")
+ mkdir -p "${CTDB_BASE}/share/events/${_b}"
done
}