mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
dcca723ace
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
18 lines
372 B
Bash
Executable File
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
|