Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685934 - sys-fs/e2fsprogs-1.45.1: e2scrub_all cronjob fails if lvcreate (sys-fs/lvm2) is not installed
Summary: sys-fs/e2fsprogs-1.45.1: e2scrub_all cronjob fails if lvcreate (sys-fs/lvm2) ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-14 08:13 UTC by Matt Whitlock
Modified: 2019-05-14 11:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2019-05-14 08:13:12 UTC
sys-fs/e2fsprogs-1.45.1 installs /etc/cron.d/e2scrub_all, which specifies a cronjob that invokes /sbin/e2scrub_all, which requires lvcreate or else prints this message:

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

This output unfortunately triggers cron to email the administrator with this pointless message every day.

If sys-fs/lvm2 is not installed (or is installed with USE="device-mapper-only"), then sys-fs/e2fsprogs should not install a cronjob that complains about lvcreate not being installed.
Comment 1 Tomáš Mózes 2019-05-14 08:37:13 UTC
+1

By the way, is there a reason to have 2 slashes before e2scrub_all?
10 3 * * * root test -e /run/systemd/system || //sbin/e2scrub_all -A -r
Comment 2 Matt Whitlock 2019-05-14 08:43:09 UTC
(In reply to Tomáš Mózes from comment #1)
> By the way, is there a reason to have 2 slashes before e2scrub_all?

It doesn't hurt, but it's sloppy. I assume it comes from a careless variable substitution of the form "${ROOT}/sbin/e2scrub_all". When ROOT="/", then such substitution produces "//sbin/e2scrub_all". A substitution of this form should be changed to the form "${ROOT%/}/sbin/e2scrub_all" to avoid the double slash.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-05-14 09:40:32 UTC
(In reply to Matt Whitlock from comment #2)
> (In reply to Tomáš Mózes from comment #1)
> > By the way, is there a reason to have 2 slashes before e2scrub_all?
> 
> It doesn't hurt, but it's sloppy. I assume it comes from a careless variable
> substitution of the form "${ROOT}/sbin/e2scrub_all". When ROOT="/", then
> such substitution produces "//sbin/e2scrub_all". A substitution of this form
> should be changed to the form "${ROOT%/}/sbin/e2scrub_all" to avoid the
> double slash.

It's coming from

  --with-root-prefix="${EPREFIX}/"

configure option. Simply dropping the trailing slash does the trick.

I have a working fix but cannot commit it because of some keyword conflicts...
Comment 4 Larry the Git Cow gentoo-dev 2019-05-14 09:55:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5cad1dc885bf5fce971a9a514bcc6776cd842c9

commit f5cad1dc885bf5fce971a9a514bcc6776cd842c9
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-05-14 09:50:24 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-05-14 09:55:32 +0000

    sys-fs/e2fsprogs: Revbump to make cron script optional
    
    because of its dependency to sys-fs/lvm2
    
    Also remove trailing slash from --with-root-prefix configure option
    
    Closes: https://bugs.gentoo.org/685934
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 .../{e2fsprogs-1.45.1.ebuild => e2fsprogs-1.45.1-r1.ebuild}        | 7 ++++---
 sys-fs/e2fsprogs/metadata.xml                                      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
Comment 5 Tomáš Mózes 2019-05-14 11:44:24 UTC
Thank you Lars.