Gentoo Archives: gentoo-dev

From: David Michael <fedora.dm0@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] user.eclass ignores ROOT/SYSROOT
Date: Tue, 05 May 2020 20:48:01
Message-Id: CAEvUa7=Wv7pC7iOVhHF8Uz_0fAR0ro=dxb4aYXg0tTO6PAWJGg@mail.gmail.com
In Reply to: [gentoo-dev] user.eclass ignores ROOT/SYSROOT by Peter Stuge
1 On Tue, May 5, 2020 at 4:22 PM Peter Stuge <peter@×××××.se> wrote:
2 > Hi,
3 >
4 > I'm trying something out over here and I'm surprised to find that
5 > acct-group/* do not work with ROOT+SYSROOT != "/".
6 >
7 > Should I file yet another bug about this?
8 >
9 > I suppose the limitation is in user.eclass, but what about the 11 bugs
10 > already filed about exactly this problem?
11 >
12 > They are easy to see in the dup bug list at https://bugs.gentoo.org/53269
13 >
14 > Unfortunately mgorny closed 53269 WONTFIX because GLEP-27 is Deferred,
15 > causing all dup and dep bugs to be forgotten. Sad panda.
16 >
17 > --8<-- reproduce
18 > # export r=$(mktemp -d)
19 > # ROOT=$r SYSROOT=$r strace -fe execve emerge baselayout acct-group/ftp 2>&1 | grep groupadd
20 > [pid 13269] execve("/usr/sbin/groupadd", ["groupadd", "-r", "-g", "21", "ftp"], 0x5d7e299e2340 /* 227 vars */) = 0
21 > groupadd: cannot lock /etc/group; try again later.
22 > * groupadd -r ${opts} "${egroup}" || die
23 > * groupadd -r ${opts} "${egroup}" || die
24 > -->8--
25 >
26 > In my particular case -R $r would work just fine, but as can be seen
27 > in several of those 11 dup bugs it is not a general solution.
28 >
29 > Any ideas on how to solve this?
30
31 I know it's not a general fix, but my solution for building a separate
32 systemd root was to use sysusers. You could try the eclass patch(es)
33 at https://bugs.gentoo.org/702624 if you're using at least systemd
34 245. (Older versions work if you apply the upstream commit linked in
35 the bug.) If you're running a systemd host with a non-systemd target,
36 you can still probably run "systemd-sysusers --root=$ROOT" after
37 emerge to generate the accounts that way.
38
39 Thanks.
40
41 David