mirror_zfs/cmd/zed/Makefile.am
Brian Behlendorf 904ea2763e Add automatic hot spare functionality
When a vdev starts getting I/O or checksum errors it is now
possible to automatically rebuild to a hot spare device.

To cleanly support this functionality in a shell script some
additional information was added to all zevent ereports which
include a vdev.  This covers both io and checksum zevents but
may be used but other scripts.

In the Illumos FMA solution the same information is required
but it is retrieved through the libzfs library interface.
Specifically the following members were added:

  vdev_spare_paths  - List of vdev paths for all hot spares.
  vdev_spare_guids  - List of vdev guids for all hot spares.
  vdev_read_errors  - Read errors for the problematic vdev
  vdev_write_errors - Write errors for the problematic vdev
  vdev_cksum_errors - Checksum errors for the problematic vdev.

By default the required hot spare scripts are installed but this
functionality is disabled.  To enable hot sparing uncomment the
ZED_SPARE_ON_IO_ERRORS and ZED_SPARE_ON_CHECKSUM_ERRORS in the
/etc/zfs/zed.d/zed.rc configuration file.

These scripts do no add support for the autoexpand property. At
a minimum this requires adding a new udev rule to detect when
a new device is added to the system.  It also requires that the
autoexpand policy be ported from Illumos, see:

  https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c

Support for detecting the correct name of a vdev when it's not
a whole disk was added by Turbo Fredriksson.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Issue #2
2014-04-02 13:10:08 -07:00

67 lines
1.9 KiB
Makefile

include $(top_srcdir)/config/Rules.am
DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include
sbin_PROGRAMS = zed
zed_SOURCES = \
$(top_srcdir)/cmd/zed/zed.c \
$(top_srcdir)/cmd/zed/zed.h \
$(top_srcdir)/cmd/zed/zed_conf.c \
$(top_srcdir)/cmd/zed/zed_conf.h \
$(top_srcdir)/cmd/zed/zed_event.c \
$(top_srcdir)/cmd/zed/zed_event.h \
$(top_srcdir)/cmd/zed/zed_exec.c \
$(top_srcdir)/cmd/zed/zed_exec.h \
$(top_srcdir)/cmd/zed/zed_file.c \
$(top_srcdir)/cmd/zed/zed_file.h \
$(top_srcdir)/cmd/zed/zed_log.c \
$(top_srcdir)/cmd/zed/zed_log.h \
$(top_srcdir)/cmd/zed/zed_strings.c \
$(top_srcdir)/cmd/zed/zed_strings.h
zed_LDADD = \
$(top_builddir)/lib/libavl/libavl.la \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libspl/libspl.la \
$(top_builddir)/lib/libzfs/libzfs.la
zedconfdir = $(sysconfdir)/zfs/zed.d
dist_zedconf_DATA = \
$(top_srcdir)/cmd/zed/zed.d/zed.rc
zedexecdir = $(libexecdir)/zfs/zed.d
dist_zedexec_SCRIPTS = \
$(top_srcdir)/cmd/zed/zed.d/all-debug.sh \
$(top_srcdir)/cmd/zed/zed.d/all-syslog.sh \
$(top_srcdir)/cmd/zed/zed.d/checksum-email.sh \
$(top_srcdir)/cmd/zed/zed.d/checksum-spare.sh \
$(top_srcdir)/cmd/zed/zed.d/data-email.sh \
$(top_srcdir)/cmd/zed/zed.d/generic-email.sh \
$(top_srcdir)/cmd/zed/zed.d/io-email.sh \
$(top_srcdir)/cmd/zed/zed.d/io-spare.sh \
$(top_srcdir)/cmd/zed/zed.d/resilver.finish-email.sh \
$(top_srcdir)/cmd/zed/zed.d/scrub.finish-email.sh
zedconfdefaults = \
all-syslog.sh \
checksum-email.sh \
checksum-spare.sh \
data-email.sh \
io-email.sh \
io-spare.sh \
resilver.finish-email.sh \
scrub.finish-email.sh
install-data-local:
$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
for f in $(zedconfdefaults); do \
test -f "$(DESTDIR)$(zedconfdir)/$${f}" -o \
-L "$(DESTDIR)$(zedconfdir)/$${f}" || \
ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
done