Written by Eric Schwimmer
It's a log file! It's a lock file! It's both! Amazing!!!
LOG="/var/log/blar.log" [[ -f $LOG ]] && /sbin/fuser -s -k -0 -w $LOG && exit 0 || exec &>>$LOG
Okay, there might be a teeny-tiny-itsy-bitsy race condition in there (i.e. the time between checking if the file exists and is open for writing by another process, and then redirecting STDOUT+STDERR to the file) but for 99.99999% of cases this should work fine.