summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorHans Rosenfeld <[email protected]>2016-07-27 15:29:15 -0700
committerBrian Behlendorf <[email protected]>2016-08-12 13:06:48 -0700
commitfb390aafc8338c62115e611dbe1917bbe7435eef (patch)
tree4b0289f3ad18c14867031de741cf97121e214963 /cmd
parent834f1e426caf4e752d2411be6f1c6138f479c96d (diff)
OpenZFS 5997 - FRU field not set during pool creation and never updated
Authored by: Hans Rosenfeld <[email protected]> Reviewed by: Dan Fields <[email protected]> Reviewed by: Josef Sipek <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Robert Mustacchi <[email protected]> Signed-off-by: Don Brady <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/5997 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1437283 Porting Notes: In addition to the OpenZFS changes this patch realigns the events with those found in OpenZFS. Events which would be logged as sysevents on illumos have been been mapped to the 'sysevent' class for Linux. In addition, several subclass names have been changed to match what is used in OpenZFS. In all cases this means a '.' was changed to an '_' in the subclass. The scripts provided by ZoL have been updated, however users which provide scripts for any of the following events will need to rename them based on the new subclass names. ereport.fs.zfs.config.sync sysevent.fs.zfs.config_sync ereport.fs.zfs.zpool.destroy sysevent.fs.zfs.pool_destroy ereport.fs.zfs.zpool.reguid sysevent.fs.zfs.pool_reguid ereport.fs.zfs.vdev.remove sysevent.fs.zfs.vdev_remove ereport.fs.zfs.vdev.clear sysevent.fs.zfs.vdev_clear ereport.fs.zfs.vdev.check sysevent.fs.zfs.vdev_check ereport.fs.zfs.vdev.spare sysevent.fs.zfs.vdev_spare ereport.fs.zfs.vdev.autoexpand sysevent.fs.zfs.vdev_autoexpand ereport.fs.zfs.resilver.start sysevent.fs.zfs.resilver_start ereport.fs.zfs.resilver.finish sysevent.fs.zfs.resilver_finish ereport.fs.zfs.scrub.start sysevent.fs.zfs.scrub_start ereport.fs.zfs.scrub.finish sysevent.fs.zfs.scrub_finish ereport.fs.zfs.bootfs.vdev.attach sysevent.fs.zfs.bootfs_vdev_attach
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zed/Makefile.am8
l---------cmd/zed/zed.d/resilver.finish-notify.sh1
l---------cmd/zed/zed.d/resilver_finish-notify.sh1
-rwxr-xr-xcmd/zed/zed.d/scrub_finish-notify.sh (renamed from cmd/zed/zed.d/scrub.finish-notify.sh)10
-rw-r--r--cmd/zed/zed_event.c5
5 files changed, 12 insertions, 13 deletions
diff --git a/cmd/zed/Makefile.am b/cmd/zed/Makefile.am
index 70e4f7f69..20e8bf1dc 100644
--- a/cmd/zed/Makefile.am
+++ b/cmd/zed/Makefile.am
@@ -49,8 +49,8 @@ dist_zedexec_SCRIPTS = \
zed.d/generic-notify.sh \
zed.d/io-notify.sh \
zed.d/io-spare.sh \
- zed.d/resilver.finish-notify.sh \
- zed.d/scrub.finish-notify.sh
+ zed.d/resilver_finish-notify.sh \
+ zed.d/scrub_finish-notify.sh
zedconfdefaults = \
all-syslog.sh \
@@ -59,8 +59,8 @@ zedconfdefaults = \
data-notify.sh \
io-notify.sh \
io-spare.sh \
- resilver.finish-notify.sh \
- scrub.finish-notify.sh
+ resilver_finish-notify.sh \
+ scrub_finish-notify.sh
install-data-hook:
$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
diff --git a/cmd/zed/zed.d/resilver.finish-notify.sh b/cmd/zed/zed.d/resilver.finish-notify.sh
deleted file mode 120000
index 2635dcce1..000000000
--- a/cmd/zed/zed.d/resilver.finish-notify.sh
+++ /dev/null
@@ -1 +0,0 @@
-scrub.finish-notify.sh \ No newline at end of file
diff --git a/cmd/zed/zed.d/resilver_finish-notify.sh b/cmd/zed/zed.d/resilver_finish-notify.sh
new file mode 120000
index 000000000..e4c56bc5f
--- /dev/null
+++ b/cmd/zed/zed.d/resilver_finish-notify.sh
@@ -0,0 +1 @@
+scrub_finish-notify.sh \ No newline at end of file
diff --git a/cmd/zed/zed.d/scrub.finish-notify.sh b/cmd/zed/zed.d/scrub_finish-notify.sh
index b4dd1dd43..2145a100a 100755
--- a/cmd/zed/zed.d/scrub.finish-notify.sh
+++ b/cmd/zed/zed.d/scrub_finish-notify.sh
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# Send notification in response to a RESILVER.FINISH or SCRUB.FINISH.
+# Send notification in response to a RESILVER_FINISH or SCRUB_FINISH.
#
-# By default, "zpool status" output will only be included for a scrub.finish
+# By default, "zpool status" output will only be included for a scrub_finish
# zevent if the pool is not healthy; to always include its output, set
# ZED_NOTIFY_VERBOSE=1.
#
@@ -19,9 +19,9 @@
[ -n "${ZEVENT_POOL}" ] || exit 9
[ -n "${ZEVENT_SUBCLASS}" ] || exit 9
-if [ "${ZEVENT_SUBCLASS}" = "resilver.finish" ]; then
+if [ "${ZEVENT_SUBCLASS}" = "resilver_finish" ]; then
action="resilver"
-elif [ "${ZEVENT_SUBCLASS}" = "scrub.finish" ]; then
+elif [ "${ZEVENT_SUBCLASS}" = "scrub_finish" ]; then
action="scrub"
else
zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\""
@@ -33,7 +33,7 @@ zed_check_cmd "${ZPOOL}" || exit 9
# For scrub, suppress notification if the pool is healthy
# and verbosity is not enabled.
#
-if [ "${ZEVENT_SUBCLASS}" = "scrub.finish" ]; then
+if [ "${ZEVENT_SUBCLASS}" = "scrub_finish" ]; then
healthy="$("${ZPOOL}" status -x "${ZEVENT_POOL}" \
| grep "'${ZEVENT_POOL}' is healthy")"
[ -n "${healthy}" ] && [ "${ZED_NOTIFY_VERBOSE}" -eq 0 ] && exit 3
diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c
index bd298dc41..7d819b803 100644
--- a/cmd/zed/zed_event.c
+++ b/cmd/zed/zed_event.c
@@ -748,9 +748,8 @@ _zed_event_add_env_preserve(uint64_t eid, zed_strings_t *zsp)
/*
* Compute the "subclass" by removing the first 3 components of [class]
- * (which seem to always be either "ereport.fs.zfs" or "resource.fs.zfs").
- * Return a pointer inside the string [class], or NULL if insufficient
- * components exist.
+ * (which will always be of the form "*.fs.zfs"). Return a pointer inside
+ * the string [class], or NULL if insufficient components exist.
*/
static const char *
_zed_event_get_subclass(const char *class)