summaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed.d
diff options
context:
space:
mode:
authorAntonio Russo <[email protected]>2018-05-11 15:44:14 -0400
committerBrian Behlendorf <[email protected]>2018-05-11 12:44:14 -0700
commit68fded814692c6a7fa7ca1f584a34a92aaa279af (patch)
treef0201a8caaf0050745b92761f0b65eaa699296c3 /cmd/zed/zed.d
parent29badadd4e3af86975bcaa23acca0e939f954af2 (diff)
Add canonical mount options zfs-mount-generator
lib/libzfs/libzfs_mount.c:zfs_add_options provides the canonical mount options used by a `zfs mount` command. Because we cannot call `zfs mount` directly from a systemd.mount unit, we mirror that logic in zfs-mount-generator. The zed script is updated to cache these properties as well. Include a mini-tutorial in the manual page, properly substitute configuration paths in zfs-mount-generator.8.in, and standardize the Makefile. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #7453
Diffstat (limited to 'cmd/zed/zed.d')
-rwxr-xr-xcmd/zed/zed.d/history_event-zfs-list-cacher.sh.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in b/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in
index 348c8d67a..c1513cf3a 100755
--- a/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in
+++ b/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in
@@ -44,9 +44,10 @@ case "${ZEVENT_HISTORY_INTERNAL_NAME}" in
;;
set|inherit)
- # Only act if the mountpoint or canmount setting is altered.
- case "${ZEVENT_HISTORY_INTERNAL_STR}" in
- canmount=*|mountpoint=*) ;;
+ # Only act if one of the tracked properties is altered.
+ case "${ZEVENT_HISTORY_INTERNAL_STR%%=*}" in
+ canmount|mountpoint|atime|relatime|devices|exec| \
+ readonly|setuid|nbmand) ;;
*) exit 0 ;;
esac
;;
@@ -60,8 +61,10 @@ esac
zed_lock zfs-list
trap abort_alter EXIT
-"${ZFS}" list -H -tfilesystem -oname,mountpoint,canmount -r "${ZEVENT_POOL}" \
- >"${FSLIST_TMP}"
+PROPS="name,mountpoint,canmount,atime,relatime,devices,exec,readonly"
+PROPS="${PROPS},setuid,nbmand"
+
+"${ZFS}" list -H -t filesystem -o $PROPS -r "${ZEVENT_POOL}" > "${FSLIST_TMP}"
# Sort the output so that it is stable
sort "${FSLIST_TMP}" -o "${FSLIST_TMP}"