Bug#928977: e2fsprogs: e2scrub_all cron job complains about lack of lvm2

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#928977: e2fsprogs: e2scrub_all cron job complains about lack of lvm2

Jon DeVree-2
Package: e2fsprogs
Version: 1.45.1-1
Severity: normal

After the latest upgrade of e2fsprogs I started getting email from cron
about lvm2 not being installed:

Subject: Cron <root@feynman> test -e /run/systemd/system || /sbin/e2scrub_all
        -A -r

e2scrub_all: can't find lvcreate --- is lvm2 installed?


Since lvm2 is not a dependency of e2fsprogs this cron job should not
trigger an email if it is not installed.

-- System Information:
Debian Release: 10.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.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.33.1-0.1
ii  libc6        2.28-10
ii  libcom-err2  1.45.1-1
ii  libext2fs2   1.45.1-1
ii  libss2       1.45.1-1
ii  libuuid1     2.33.1-0.1

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

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  <none>
pn  fuse2fs        <none>
pn  gpart          <none>
ii  parted         3.2-25

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#928977: patch

Adam Borowski-3
Control: severity -1 important
Control: tags -1 +patch

Hi!
Cron spam from a Priority:Required package is not something I'd consider
fit for Buster.  Thus, could you please apply this patch?


Meow!
--
⢀⣴⠾⠻⢶⣦⠀ Latin:   meow 4 characters, 4 columns,  4 bytes
⣾⠁⢠⠒⠀⣿⡁ Greek:   μεου 4 characters, 4 columns,  8 bytes
⢿⡄⠘⠷⠚⠋  Runes:   ᛗᛖᛟᚹ 4 characters, 4 columns, 12 bytes
⠈⠳⣄⠀⠀⠀⠀ Chinese: 喵   1 character,  2 columns,  3 bytes <-- best!

0001-Stop-cron-spam-if-lvm2-is-not-installed.patch (936 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#928977: patch

Theodore Ts'o-2
Control: tags -1 +pending

On Thu, May 16, 2019 at 05:17:10PM +0200, Adam Borowski wrote:
> Cron spam from a Priority:Required package is not something I'd consider
> fit for Buster.  Thus, could you please apply this patch?

Thanks for the patch, applied!

                                        - Ted

Reply | Threaded
Open this post in threaded view
|

Bug#928977: patch

Theodore Ts'o-2
On Thu, May 16, 2019 at 02:47:06PM -0400, Theodore Ts'o wrote:
> Control: tags -1 +pending
>
> On Thu, May 16, 2019 at 05:17:10PM +0200, Adam Borowski wrote:
> > Cron spam from a Priority:Required package is not something I'd consider
> > fit for Buster.  Thus, could you please apply this patch?
>
> Thanks for the patch, applied!

Actually, looking at this more closely, I think this might be a better
way to address things, since I need to deal with both the systemd and
cron cases:

commit ec23e6820b64509a4640c61ec94febdd7efd2905
Author: Theodore Ts'o <[hidden email]>
Date:   Thu May 16 14:56:37 2019 -0400

    e2scrub: stop cron spam if lvm2 is not installed.
   
    Addresses-Debian-Bug: #928977
   
    Signed-off-by: Theodore Ts'o <[hidden email]>

diff --git a/scrub/e2scrub_all.cron.in b/scrub/e2scrub_all.cron.in
index 7d42c3f2e..5bf83ec97 100644
--- a/scrub/e2scrub_all.cron.in
+++ b/scrub/e2scrub_all.cron.in
@@ -1,2 +1,2 @@
 30 3 * * 0 root test -e /run/systemd/system || @pkglibdir@/e2scrub_all_cron
-10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -A -r
+10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -C -A -r
diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
index 31ebc7970..eb7b55bee 100644
--- a/scrub/e2scrub_all.in
+++ b/scrub/e2scrub_all.in
@@ -26,6 +26,7 @@ if (( $EUID != 0 )); then
 fi
 
 scrub_all=0
+run_from_cron=0
 snap_size_mb=256
 reap=0
 conffile="@root_sysconfdir@/e2scrub.conf"
@@ -73,6 +74,7 @@ while getopts "nrAV" opt; do
  "n") DBG="echo Would execute: " ;;
  "r") scrub_args="${scrub_args} -r"; reap=1;;
  "A") scrub_all=1;;
+ "C") run_from_cron=1;
  "V") print_version; exitcode 0;;
  *) print_help; exitcode 2;;
  esac
@@ -84,13 +86,19 @@ shift "$((OPTIND - 1))"
 # when e2scrub_all is run out of cron or a systemd timer.
 
 if ! type lsblk >& /dev/null ; then
+    if [ "${run_from_cron}" -eq 1 ] ; then
+ exitcode 0
+    fi
     echo "e2scrub_all: can't find lsblk --- is util-linux installed?"
-    exitcode 0
+    exitcode 1
 fi
 
 if ! type lvcreate >& /dev/null ; then
+    if [ "${run_from_cron}" -eq 1 ] ; then
+ exitcode 0
+    fi
     echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?"
-    exitcode 0
+    exitcode 1
 fi
 
 # Find scrub targets, make sure we only do this once.
diff --git a/scrub/e2scrub_all.service.in b/scrub/e2scrub_all.service.in
index 20f42bfe3..77b6ad599 100644
--- a/scrub/e2scrub_all.service.in
+++ b/scrub/e2scrub_all.service.in
@@ -8,5 +8,5 @@ Documentation=man:e2scrub_all(8)
 [Service]
 Type=oneshot
 Environment=SERVICE_MODE=1
-ExecStart=@root_sbindir@/e2scrub_all
+ExecStart=@root_sbindir@/e2scrub_all -C
 SyslogIdentifier=e2scrub_all
diff --git a/scrub/e2scrub_all_cron.in b/scrub/e2scrub_all_cron.in
index f9cff878c..bc26fee3d 100644
--- a/scrub/e2scrub_all_cron.in
+++ b/scrub/e2scrub_all_cron.in
@@ -65,4 +65,4 @@ on_ac_power() {
 test -e /run/systemd/system && exit 0
 on_ac_power || exit 0
 
-exec @root_sbindir@/e2scrub_all
+exec @root_sbindir@/e2scrub_all -C
diff --git a/scrub/e2scrub_reap.service.in b/scrub/e2scrub_reap.service.in
index cf26437cd..40511f735 100644
--- a/scrub/e2scrub_reap.service.in
+++ b/scrub/e2scrub_reap.service.in
@@ -16,7 +16,7 @@ NoNewPrivileges=yes
 User=root
 IOSchedulingClass=idle
 CPUSchedulingPolicy=idle
-ExecStart=@root_sbindir@/e2scrub_all -A -r
+ExecStart=@root_sbindir@/e2scrub_all -C -A -r
 SyslogIdentifier=%N
 RemainAfterExit=no
 

Reply | Threaded
Open this post in threaded view
|

Bug#928977: e2fsprogs: e2scrub_all cron job complains about lack of lvm2

Thorsten Glaser
In reply to this post by Jon DeVree-2
Package: e2fsprogs
Version: 1.45.1-1
Followup-For: Bug #928977

The patch from Message #26 looks good, and I would welcome it.
(The idea, to exit silently if only the prerequisite is missing,
and only if called as cronjob or newspeak equivalent, is good.)

-- System Information:
Debian Release: 10.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 4.19.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages e2fsprogs depends on:
ii  libblkid1    2.33.1-0.1
ii  libc6        2.28-10
ii  libcom-err2  1.45.1-1
ii  libext2fs2   1.45.1-1
ii  libss2       1.45.1-1
ii  libuuid1     2.33.1-0.1

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

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  <none>
pn  fuse2fs        <none>
pn  gpart          <none>
ii  parted         3.2-25

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#928977: also cron spam when lvm is installed but not in use

Joey Hess-8
In reply to this post by Jon DeVree-2
I do not use lvm on my laptop, but I have lvm2 installed because I
sometimes attach removable media that uses it. And so it does not seem
sufficient to avoid complaining when lvm2 is not installed, because I am
also getting cron spam:

   So sorry, the automatic e2scrub of / on darkstar.kitenet.net failed.
   
   A log of what happened follows:
   ● [hidden email] - Online ext4 Metadata Check for /
       Loaded: loaded (/lib/systemd/system/e2scrub@.service; static; vendor preset: enabled)
       Active: failed (Result: exit-code) since Sun 2019-05-19 07:32:22 EDT; 91ms ago
         Docs: man:e2scrub(8)
      Process: 5634 ExecStart=/sbin/e2scrub -t / (code=exited, status=1/FAILURE)
     Main PID: 5634 (code=exited, status=1/FAILURE)
   
    May 19 07:32:20 darkstar systemd[1]: Starting Online ext4 Metadata Check for /...
    May 19 07:32:20 darkstar e2scrub@-[5634]: /: Not connnected to a LVM logical volume.

--
see shy jo

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#928977: also cron spam when lvm is installed but not in use

Theodore Ts'o-2
On Sun, May 19, 2019 at 11:30:56AM -0400, Joey Hess wrote:
> I do not use lvm on my laptop, but I have lvm2 installed because I
> sometimes attach removable media that uses it. And so it does not seem
> sufficient to avoid complaining when lvm2 is not installed, because I am
> also getting cron spam:

Yeah, sorry, that's Bug #929186, and it's fixed by:

commit fbb9bfa4a5925f8049ef51d8f59eb94920781ec8
Author: Theodore Ts'o <[hidden email]>
Date:   Sat May 18 23:04:49 2019 -0400

    e2scrub_all: avoid scrubbing all devices when there is nothing to scrub
   
    Running lsblk when there are no valid block devicse results in
    generating all block devices as the list of devices to scrub; this
    results in a lot of e2scrub_all failures.
   
    Addresses-Debian-Bug: #929186
   
    Signed-off-by: Theodore Ts'o <[hidden email]>

I'll get a fixed version of e2fsprogs out to unstable shortly...

                   - Ted