mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 02:46:29 +00:00

Historically, ZED has blindly spawned off zedlets in parallel and never worried about their completion order. This means that you can potentially have zedlets for event number 2 starting before zedlets for event number 1 had finished. Most of the time this is fine, and it actually helps a lot when the system is getting spammed with hundreds of events. However, there are times when you want your zedlets to be executed in sequence with the event ID. That is where synchronous zedlets come in. ZED will wait for all previously spawned zedlets to finish before running a synchronous zedlet. Synchronous zedlets are guaranteed to be the only zedlet running. No other zedlets may run in parallel with a synchronous zedlet. Users should be careful to only use synchronous zedlets when needed, since they decrease parallelism. To make a zedlet synchronous, simply add a "-sync-" immediately following the event name in the zedlet's file name: EVENT_NAME-sync-ZEDLETNAME.sh For example, if you wanted a synchronous statechange script: statechange-sync-myzedlet.sh Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes #17335
60 lines
1.8 KiB
Makefile
60 lines
1.8 KiB
Makefile
zedconfdir = $(sysconfdir)/zfs/zed.d
|
|
dist_zedconf_DATA = \
|
|
%D%/zed-functions.sh \
|
|
%D%/zed.rc
|
|
|
|
zedexecdir = $(zfsexecdir)/zed.d
|
|
|
|
dist_zedexec_SCRIPTS = \
|
|
%D%/all-debug.sh \
|
|
%D%/all-syslog.sh \
|
|
%D%/data-notify.sh \
|
|
%D%/deadman-sync-slot_off.sh \
|
|
%D%/generic-notify.sh \
|
|
%D%/pool_import-sync-led.sh \
|
|
%D%/resilver_finish-notify.sh \
|
|
%D%/resilver_finish-start-scrub.sh \
|
|
%D%/scrub_finish-notify.sh \
|
|
%D%/statechange-sync-led.sh \
|
|
%D%/statechange-notify.sh \
|
|
%D%/statechange-sync-slot_off.sh \
|
|
%D%/trim_finish-notify.sh \
|
|
%D%/vdev_attach-sync-led.sh \
|
|
%D%/vdev_clear-sync-led.sh
|
|
|
|
nodist_zedexec_SCRIPTS = \
|
|
%D%/history_event-zfs-list-cacher.sh
|
|
|
|
SUBSTFILES += $(nodist_zedexec_SCRIPTS)
|
|
|
|
zedconfdefaults = \
|
|
all-syslog.sh \
|
|
data-notify.sh \
|
|
deadman-sync-slot_off.sh \
|
|
history_event-zfs-list-cacher.sh \
|
|
pool_import-sync-led.sh \
|
|
resilver_finish-notify.sh \
|
|
resilver_finish-start-scrub.sh \
|
|
scrub_finish-notify.sh \
|
|
statechange-sync-led.sh \
|
|
statechange-notify.sh \
|
|
statechange-sync-slot_off.sh \
|
|
vdev_attach-sync-led.sh \
|
|
vdev_clear-sync-led.sh
|
|
|
|
dist_noinst_DATA += %D%/README
|
|
|
|
INSTALL_DATA_HOOKS += zed-install-data-hook
|
|
zed-install-data-hook:
|
|
$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
|
|
set -x; for f in $(zedconfdefaults); do \
|
|
[ -f "$(DESTDIR)$(zedconfdir)/$${f}" ] ||\
|
|
[ -L "$(DESTDIR)$(zedconfdir)/$${f}" ] || \
|
|
$(LN_S) "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
|
|
done
|
|
|
|
SHELLCHECKSCRIPTS += $(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)
|
|
$(call SHELLCHECK_OPTS,$(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)): SHELLCHECK_SHELL = sh
|
|
# False positive: 1>&"${ZED_FLOCK_FD}" looks suspiciously similar to a >&filename bash extension
|
|
$(call SHELLCHECK_OPTS,$(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)): CHECKBASHISMS_IGNORE = -e 'should be >word 2>&1' -e '&"$${ZED_FLOCK_FD}"'
|