Package: debsums
Version: 3.0.2.3
Severity: normal

Dear Maintainers,

I noticed that the debsums (daily/weekly/monthly) cron jobs will throw an error 
when the scripts are run as systemd units - which is the case if you use 
systemd-cron as a replacement of the traditional cron daemon.

The error message reads:
tee: /proc/self/fd/3: No such device or address

This is caused by the output redirection to a temporary file descriptor so the 
output can be sent to stdout as well as the log daemon. Systemd, by default, 
limits pipes to stdout and stderr only, which is why `tee /proc/self/fd/3' 
fails.

I found an easy fix for this, however. Process substitution allows for the same 
output duplication/redirection and works regardless of being run as a systemd 
unit or not.

The attached diff works for me.

Would you consider shipping this simple fix as a stable update? Thank you!


Regards,

Timo


--- /etc/cron.weekly/debsums.orig	2020-02-25 14:42:28.000000000 +0100
+++ /etc/cron.weekly/debsums	2025-09-30 21:32:45.268549276 +0200
@@ -19,9 +19,7 @@
     IONICE="/usr/bin/ionice -c3"
 fi
 
-exec 3>&1
-
-$IONICE $debsums -cs 2>&1 | egrep -vf "$ignorefile" | tee /proc/self/fd/3 | sed 's/^debsums: //' | logger -t debsums
+$IONICE $debsums -cs 2>&1  | egrep -vf "$ignorefile" | tee >(sed 's/^debsums: //' | logger -t debsums)
 
 # Exit with a normal status code even if errors (which could be ignored) were found
 exit 0

Reply via email to