Package: e2fsprogs
Version: 1.45.4-1
Severity: normal
File: /etc/cron.d/e2scrub_all

Dear e2fsprogs maintainers,

the second cron job inside /etc/cron.d/e2scrub_all ("test -e
/run/systemd/system || SERVICE_MODE=1 /sbin/e2scrub_all -A -r") always
sends mail on devices which have a (in my case permanently mounted) SD
card reader connected:

------------------------------------------------------------------------
>From r...@c6.deuxchevaux.org  Tue Dec  3 03:10:05 2019
From: "(Cron Daemon)" <r...@c6.deuxchevaux.org>
To: r...@c6.deuxchevaux.org
Subject: Cron <root@c6> test -e /run/systemd/system || SERVICE_MODE=1
 /sbin/e2scrub_all -A -r

  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdg: open failed: No medium found
  /dev/sdh: open failed: No medium found
  /dev/sdi: open failed: No medium found
------------------------------------------------------------------------

Another requirement to trigger these mails might be to not have systemd
as init system.

I see potentially two variants to fix this:

* Quick and dirty: Replace "/sbin/e2scrub_all -A -r" with
  "/sbin/e2scrub_all -A -r |& fgrep -v 'open failed: No medium
  found'". This might though cause issues because then the exit code
  cron will look at is the one from fgrep and no more the one from
  e2scrub_all. There are surely ways to work around that like capturing
  the exit code in a variable and calling "exit $that_variable" at the
  end, but that's already no more "KISS".

* Implement a new option in /sbin/e2scrub_all to suppress the warning
  about the "No medium found" condition. Would be clean, useful also for
  other use cases and IMHO the correct way to fix this. It though
  likely needs more effort to implement.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.3.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages e2fsprogs depends on:
ii  libblkid1    2.34-0.1
ii  libc6        2.29-3
ii  libcom-err2  1.45.4-1
ii  libext2fs2   1.45.4-1
ii  libss2       1.45.4-1
ii  libuuid1     2.34-0.1
ii  logsave      1.45.4-1

Versions of packages e2fsprogs recommends:
pn  e2fsprogs-l10n  <none>

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  <none>
ii  fuse2fs        1.45.4-1
ii  gpart          1:0.3-6
ii  parted         3.3-1

-- no debconf information

Reply via email to