mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-29 12:29:35 +03:00
639b18944a
Some usage patterns like send/recv of replication streams can produce a large number of events. In such a case, the current all-syslog.sh zedlet will hold up to its name, and flood the logs with mostly redundant information. Two mitigate this situation, this changeset introduces to new variables ZED_SYSLOG_SUBCLASS_INCLUDE and ZED_SYSLOG_SUBCLASS_EXCLUDE to zed.rc that give more control over which event classes end up in the syslog. Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Daniel Kobras <d.kobras@science-computing.de> Closes #6886 Closes #7260
27 lines
565 B
Bash
Executable File
27 lines
565 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
|
|
|
|
lockfile="$(basename -- "${ZED_DEBUG_LOG}").lock"
|
|
|
|
umask 077
|
|
zed_lock "${lockfile}"
|
|
exec >> "${ZED_DEBUG_LOG}"
|
|
|
|
printenv | sort
|
|
echo
|
|
|
|
exec >&-
|
|
zed_unlock "${lockfile}"
|
|
exit 0
|