Skip to content

Commit

Permalink
zed.d/*-notify.sh: use mktemp instead of generating temp path manually
Browse files Browse the repository at this point in the history
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#11935
  • Loading branch information
nabijaczleweli authored and RageLtMan committed May 31, 2021
1 parent c16a50d commit 66890cc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/data-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ zed_rate_limit "${rate_limit_tag}" || exit 3

umask 077
note_subject="ZFS ${ZEVENT_SUBCLASS} error for ${ZEVENT_POOL} on $(hostname)"
note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
note_pathname="$(mktemp)"
{
echo "ZFS has detected a data error:"
echo
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/generic-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ umask 077
pool_str="${ZEVENT_POOL:+" for ${ZEVENT_POOL}"}"
host_str=" on $(hostname)"
note_subject="ZFS ${ZEVENT_SUBCLASS} event${pool_str}${host_str}"
note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
note_pathname="$(mktemp)"
{
echo "ZFS has posted the following event:"
echo
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/scrub_finish-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi

umask 077
note_subject="ZFS ${ZEVENT_SUBCLASS} event for ${ZEVENT_POOL} on $(hostname)"
note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
note_pathname="$(mktemp)"
{
echo "ZFS has finished a ${action}:"
echo
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/statechange-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi

umask 077
note_subject="ZFS device fault for pool ${ZEVENT_POOL_GUID} on $(hostname)"
note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
note_pathname="$(mktemp)"
{
if [ "${ZEVENT_VDEV_STATE_STR}" = "FAULTED" ] ; then
echo "The number of I/O errors associated with a ZFS device exceeded"
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/trim_finish-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zed_check_cmd "${ZPOOL}" || exit 9

umask 077
note_subject="ZFS ${ZEVENT_SUBCLASS} event for ${ZEVENT_POOL} on $(hostname)"
note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
note_pathname="$(mktemp)"
{
echo "ZFS has finished a trim:"
echo
Expand Down

0 comments on commit 66890cc

Please sign in to comment.