mirror_zfs/cmd/zed/zed.d/all-debug.sh
Chris Dunlap dcca723ace Refer to ZED's scripts as ZEDLETs
The executables invoked by the ZED in response to a given zevent
have been generically referred to as "scripts".  By convention,
these scripts have aimed to be /bin/sh compatible for reasons of
portability and comprehensibility.  However, the ZED only requires
they be executable and (ideally) capable of reading environment
variables.  As such, these scripts are now referred to as ZEDLETs
(ZFS Event Daemon Linkage for Executable Tasks).

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2735
2014-09-25 13:54:17 -07:00

18 lines
372 B
Bash
Executable File

#!/bin/sh
#
# Log all environment variables to ZED_DEBUG_LOG.
#
test -f "${ZED_ZEDLET_DIR}/zed.rc" && . "${ZED_ZEDLET_DIR}/zed.rc"
# Override the default umask to restrict access to a newly-created logfile.
umask 077
# Append stdout to the logfile after obtaining an advisory lock.
exec >> "${ZED_DEBUG_LOG:=/tmp/zed.debug.log}"
flock -x 1
printenv | sort
echo
exit 0