summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-10-15 22:34:45 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-10-15 22:34:45 (EDT)
commit15e25cf799c4331360a7ee687513af4ad4e91c5f (patch)
treeacac7c475c3fd04571790e656ae51c0df5cd156c
parentc0542ff0bb3c1da12c7d5bd2cbe2bc79dfb28d62 (diff)
downloadprintq-15e25cf799c4331360a7ee687513af4ad4e91c5f.zip
printq-15e25cf799c4331360a7ee687513af4ad4e91c5f.tar.gz
printq-15e25cf799c4331360a7ee687513af4ad4e91c5f.tar.bz2
Log errorsHEADmaster
-rwxr-xr-xprintq8
1 files changed, 6 insertions, 2 deletions
diff --git a/printq b/printq
index b4f9a23..a33f5be 100755
--- a/printq
+++ b/printq
@@ -34,7 +34,10 @@ print_from_queue()
done 0<"${queue}/.options"
logger -t 'printq' "Printing ${queue}/${file}"
- lp "${@}" "${queue}/${file}" || return 1
+ if ! out="$(lp "${@}" "${queue}/${file}" 2>&1)"; then
+ logger -t 'printq' "Failed to print: ${out}"
+ return 1
+ fi
rm -f "${queue}/${file}" || return 1
return 0
@@ -58,10 +61,11 @@ watch_queues()
done
dest="${dest%%/*}"
print_from_queue "${dest}" "${watched_filename}" \
- "${event_filename}" || return 1
+ "${event_filename}" || : # Don't exit on error.
done
# Shouldn't reach this point.
+ logger -t 'printq' 'Failed to watch queues'
return 1
}