Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878603 - =sys-fs/lxcfs-5.0.2-r1: Broken /var/lib/lxc path in lxc.mount.hook script
Summary: =sys-fs/lxcfs-5.0.2-r1: Broken /var/lib/lxc path in lxc.mount.hook script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Joonas Niilola
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-29 09:42 UTC by Alix
Modified: 2022-11-01 12:19 UTC (History)
1 user (show)

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


Attachments
Example of lxc.mount.hook with incorrect paths (lxc.mount.hook,3.54 KB, application/x-shellscript)
2022-10-29 09:43 UTC, Alix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alix 2022-10-29 09:42:33 UTC
/usr/share/lxcfs/lxc.mount.hook script is rendered with invalid "{{LXCFSTARGETDIR}}" macro substitution throughout the whole file: it's replaced with /var/lib/lib/lxcfs, while correct path would be /var/lib/lxcfs.

https://github.com/lxc/lxcfs/blob/lxcfs-5.0.1/share/lxc.mount.hook.in#L18

/etc/conf.d/lxcfs is unmodified, with LXCFS_PATH="/var/lib/lxcfs".

I've poked around a bit but don't yet understand what (and why) it's happening.

Reproducible: Always
Comment 1 Alix 2022-10-29 09:43:11 UTC
Created attachment 825801 [details]
Example of lxc.mount.hook with incorrect paths
Comment 2 Alix 2022-10-29 09:45:20 UTC
Oh, and this wrong path effectively means that lxcfs is silently not getting enabled for lxc containers where it is enabled via mount script hook.
Comment 3 Joonas Niilola gentoo-dev 2022-10-31 07:48:34 UTC
Our meson.eclass sets:
  --localstatedir "${EPREFIX}/var/lib"

and lxcfs's meson.build sets:
  conf.set_quoted('LXCFSTARGETDIR', join_paths(localstatedir, 'lib/lxcfs'))

combined it becomes: ${EPREFIX}/var/lib/lib/lxcfs.

Now I wonder who's in the wrong here. The eclass, upstream meson.build or me with the ebuilds trying to switch the directory into /var/lib/lxcfs. Gonna investigate this a bit more. Thanks for the report!
Comment 4 Joonas Niilola gentoo-dev 2022-10-31 19:45:33 UTC
Filed bug #878913 - but I'm going to define it in the ebuild as a temporary fix.
Comment 5 Larry the Git Cow gentoo-dev 2022-11-01 12:19:20 UTC
The bug has been closed via the following commit(s):

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

commit 97acc1924aeab37ac145082102cc83eacc76d6b1
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-11-01 12:17:24 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-11-01 12:19:17 +0000

    app-containers/lxc: define and fix --localstatedir
    
    Closes: https://bugs.gentoo.org/878603
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-containers/lxc/{lxc-5.0.1-r1.ebuild => lxc-5.0.1-r2.ebuild} | 2 ++
 1 file changed, 2 insertions(+)

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

commit cde0a13355f738dfaf3031ec81b47c5e7bb91a20
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-11-01 11:19:04 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-11-01 12:19:17 +0000

    sys-fs/lxcfs: define and fix --localstatedir
    
    Closes: https://bugs.gentoo.org/878603
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 sys-fs/lxcfs/{lxcfs-5.0.2-r1.ebuild => lxcfs-5.0.2-r2.ebuild} | 2 ++
 1 file changed, 2 insertions(+)