[Pkg-zfsonlinux-devel] Bug#946748: [zfsutils-linux] /etc/cron.d/zfsutils-linux leads to false error mails with systemd-cron

Dirk Heinrichs dirk.heinrichs at altum.de
Sun Dec 15 08:09:52 GMT 2019


Package: zfsutils-linux
Version: 0.7.12-2+deb10u1
Severity: normal

--- Please enter the report below this line. ---
Shortly after replacing cron with systemd-cron, I received error mails
about failing zfsutils-linux cron jobs. After some debugging I found
that i only get these mails on days where the scrub should not run.
This is because of the day-of-week test in the command found in
/etc/cron.d/zfsutils-linux, which reads

[ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] &&
/usr/lib/zfs-linux/scrub

This first test of course always fails except on Sundays, leading to a
non-zero exit code, which triggers systemd-cron's (correct) behaviour
to send an error mail.

This doesn't happen if the entire command is rewritten as

if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ]; then
/usr/lib/zfs-linux/scrub; fi

or

if [ $(date +\%w) -eq 0 ]; then [ -x /usr/lib/zfs-linux/scrub ] &&
/usr/lib/zfs-linux/scrub; fi

Bye...

	Dirk

--- System information. ---
Architecture: 
Kernel:       Linux 4.19.0-6-amd64

Debian Release: 10.2
  500 stable-updates  vwakviie2ienjx6t.onion 
  500 stable          vwakviie2ienjx6t.onion 
  500 stable          sgvtcaew4bxjd7ln.onion 

--- Package information. ---
Depends                (Version) | Installed
================================-+-=============
python3                          | 3.7.3-1
python3:any                      | 
libblkid1              (>= 2.16) | 
libc6                  (>= 2.17) | 
libnvpair1linux      (>= 0.7.12) | 
libuuid1               (>= 2.16) | 
libuutil1linux       (>= 0.7.12) | 
libzfs2linux         (>= 0.7.12) | 
libzpool2linux       (>= 0.7.12) | 
zlib1g              (>= 1:1.1.4) | 


Recommends       (Version) | Installed
==========================-+-===========
lsb-base                   | 10.2019051400
zfs-modules                | 
 OR zfs-dkms               | 0.7.12-2+deb10u1
zfs-zed                    | 0.7.12-2+deb10u1


Suggests                (Version) | Installed
=================================-+-============
nfs-kernel-server                 | 
samba-common-bin      (>= 3.0.23) | 2:4.9.5+dfsg-5+deb10u1
zfs-initramfs                     | 0.7.12-2+deb10u1
 OR zfs-dracut                    | 

-- 
Dirk Heinrichs
GPG Public Key: D01B367761B0F7CE6E6D81AAD5A2E54246986015
Sichere Internetkommunikation: http://www.retroshare.org
Privacy Handbuch: https://www.privacy-handbuch.de 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20191215/ade2e6a8/attachment.sig>


More information about the Pkg-zfsonlinux-devel mailing list