summaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed.d/all-debug.sh
blob: ae64e0a799393b3157c02359ee26f53036ea20ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# Log all environment variables to ZED_DEBUG_LOG.
#
test -f "${ZED_SCRIPT_DIR}/zed.rc" && . "${ZED_SCRIPT_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