mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-29 04:19:35 +03:00
e20c9330d7
By locking the log file itself, we can omit arduous rebinding and explicit umask setting, but, perhaps more importantly, avoid permanently littering /var/lock/ with zed.debug.log.lock we will never delete It is imperative that the previous commit ("zed-functions.sh: zed_lock(): don't truncate lock") be included in any series that contains this one Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
23 lines
504 B
Bash
Executable File
23 lines
504 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Log all environment variables to ZED_DEBUG_LOG.
|
|
#
|
|
# This can be a useful aid when developing/debugging ZEDLETs since it shows the
|
|
# environment variables defined for each zevent.
|
|
|
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
|
|
|
: "${ZED_DEBUG_LOG:="${TMPDIR:="/tmp"}/zed.debug.log"}"
|
|
|
|
zed_exit_if_ignoring_this_event
|
|
|
|
zed_lock "${ZED_DEBUG_LOG}"
|
|
{
|
|
printenv | sort
|
|
echo
|
|
} 1>&"${ZED_FLOCK_FD}"
|
|
zed_unlock "${ZED_DEBUG_LOG}"
|
|
|
|
exit 0
|