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:
/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.