diff options
author | brian <brian@FreeBSD.org> | 2000-09-19 22:15:00 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-09-19 22:15:00 +0000 |
commit | fe1b76bd4420b59115d7cf400d87d714587ab64d (patch) | |
tree | 409186a0386de1295e273fb58e421ceea7245c5d | |
parent | 849996ccf50805f3e79c6e80d967540b5db018f3 (diff) | |
download | FreeBSD-src-fe1b76bd4420b59115d7cf400d87d714587ab64d.zip FreeBSD-src-fe1b76bd4420b59115d7cf400d87d714587ab64d.tar.gz |
Put temporary output in ${TMPDIR:-/tmp}
If $<basedir>_output is not set, don't redirect output
PR: 21395
-rw-r--r-- | share/man/man5/periodic.conf.5 | 3 | ||||
-rw-r--r-- | usr.sbin/periodic/periodic.8 | 9 | ||||
-rw-r--r-- | usr.sbin/periodic/periodic.sh | 5 |
3 files changed, 8 insertions, 9 deletions
diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 5e085d7..dec9717 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -66,8 +66,7 @@ the directory If this variable is set to an absolute path name, output is logged to that file, otherwise it is taken as one or more space seperated email addresses and mailed to those users. -If this variable is not set, it defaults to -.Dq root . +If this variable is not set or is empty, output is sent to standard output. .Pp For an unattended machine, suitable values for .Ar $daily_output , diff --git a/usr.sbin/periodic/periodic.8 b/usr.sbin/periodic/periodic.8 index 4ab3dec..e15ee2c 100644 --- a/usr.sbin/periodic/periodic.8 +++ b/usr.sbin/periodic/periodic.8 @@ -127,14 +127,13 @@ output. If the .Va <basedir>_output value does not begin with a -.Dq / , -it is assumed to contain a list of email addresses, and the output is -mailed to them. +.Dq / +and is not empty, it is assumed to contain a list of email addresses, and +the output is mailed to them. .Pp If .Va <basedir>_output -is not set, it defaults to -.Dq root . +is not set or is empty, output is sent to standard output. .Sh ENVIRONMENT The .Nm diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index cb849b5..35772ef 100644 --- a/usr.sbin/periodic/periodic.sh +++ b/usr.sbin/periodic/periodic.sh @@ -27,7 +27,7 @@ fi host=`hostname` export host -tmp_output=/var/run/periodic.$$ +tmp_output=${TMPDIR:-/tmp}/periodic.$$ # Execute each executable file in the directory list. If the x bit is not # set, assume the user didn't really want us to muck with it (it's a @@ -39,7 +39,8 @@ do eval output=\$${arg##*/}_output case "$output" in /*) pipe="cat >>$output";; - *) pipe="mail -s '$host ${arg##*/} run output' ${output:-root}";; + "") pipe=cat + *) pipe="mail -s '$host ${arg##*/} run output' $output";; esac success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO |