Description of problem: The recent update of mock-core-configs switch to systemd-sysusers for creating users. However it does not work in container without systemd (which is huge majority especially at built time. Version-Release number of selected component (if applicable): sh$ rpm -q mock-core-configs mock-core-configs-30.5-1.fc31.noarch How reproducible: Deterministic Steps to Reproduce: 1. docker run -ti --rm docker.io/fedora:rawhide # run rest of commands in container. 2. dnf install --setopt=install_weak_deps=False -y mock 3. getent group mock Actual results: [root@b47d695a1c20 /]# dnf install --setopt=install_weak_deps=False -y mock-core Fedora - Modular Rawhide - Developmental packages for the next Fedora release Fedora - Rawhide - Developmental packages for the next Fedora release Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: mock-core-configs noarch 30.5-1.fc31 rawhide 41 k Installing dependencies: distribution-gpg-keys noarch 1.32-2.fc31 rawhide 197 k Transaction Summary ================================================================================ Install 2 Packages Total download size: 237 k Installed size: 547 k Downloading Packages: (1/2): mock-core-configs-30.5-1.fc31.noarch.rpm 1.0 MB/s | 41 kB 00:00 (2/2): distribution-gpg-keys-1.32-2.fc31.noarch 4.5 MB/s | 197 kB 00:00 -------------------------------------------------------------------------------- Total 284 kB/s | 237 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : distribution-gpg-keys-1.32-2.fc31.noarch 1/2 Running scriptlet: mock-core-configs-30.5-1.fc31.noarch 2/2 Installing : mock-core-configs-30.5-1.fc31.noarch 2/2 warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root //snip warning: group mock does not exist - using root warning: group mock does not exist - using root warning: group mock does not exist - using root Running scriptlet: mock-core-configs-30.5-1.fc31.noarch 2/2 Verifying : distribution-gpg-keys-1.32-2.fc31.noarch 1/2 Verifying : mock-core-configs-30.5-1.fc31.noarch 2/2 Installed: mock-core-configs-30.5-1.fc31.noarch distribution-gpg-keys-1.32-2.fc31.noarch Complete! [root@b47d695a1c20 /]# getent group mock [root@b47d695a1c20 /]# echo $? 2 Expected results: [root@b47d695a1c20 /]# dnf install --setopt=install_weak_deps=False -y mock-core Fedora - Modular Rawhide - Developmental packages for the next Fedora release Fedora - Rawhide - Developmental packages for the next Fedora release Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: mock-core-configs noarch 30.5-1.fc31 rawhide 41 k Installing dependencies: distribution-gpg-keys noarch 1.32-2.fc31 rawhide 197 k Transaction Summary ================================================================================ Install 2 Packages Total download size: 237 k Installed size: 547 k Downloading Packages: (1/2): mock-core-configs-30.5-1.fc31.noarch.rpm 1.0 MB/s | 41 kB 00:00 (2/2): distribution-gpg-keys-1.32-2.fc31.noarch 4.5 MB/s | 197 kB 00:00 -------------------------------------------------------------------------------- Total 284 kB/s | 237 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : distribution-gpg-keys-1.32-2.fc31.noarch 1/2 Running scriptlet: mock-core-configs-30.5-1.fc31.noarch 2/2 Installing : mock-core-configs-30.5-1.fc31.noarch 2/2 Running scriptlet: mock-core-configs-30.5-1.fc31.noarch 2/2 Verifying : distribution-gpg-keys-1.32-2.fc31.noarch 1/2 Verifying : mock-core-configs-30.5-1.fc31.noarch 2/2 Installed: mock-core-configs-30.5-1.fc31.noarch distribution-gpg-keys-1.32-2.fc31.noarch Complete! [root@b47d695a1c20 /]# getent group mock mock:x:135: [root@b47d695a1c20 /]# echo $? 0 Additional info:
The macro %sysusers_create_package expect two parameters https://src.fedoraproject.org/rpms/mock-core-configs/blob/master/f/mock-core-configs.spec#_85 Definition: -13: sysusers_create_package %{expand:%%{?!__systemd_twoargs_%#:%%{error:This macro requires two arguments}}} systemd-sysusers --replace=%_sysusersdir/%1.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : %(cat %2) SYSTEMD_INLINE_EOF %{nil} Result in scriptlet: systemd-sysusers --replace=/usr/lib/sysusers.d/mock.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : SYSTEMD_INLINE_EOF It is obvious that "%(cat %2)" did not work. And I am not sure whether replacing mock.conf with %{_sysusersdir}/mock.conf would help because it is "%pre" scriptlet and file has not been installed yet. But I did not try [root@b47d695a1c20 /]# rpm --eval "%sysusers_create_package mock mock.conf" cat: mock.conf: No such file or directory systemd-sysusers --replace=/usr/lib/sysusers.d/mock.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : SYSTEMD_INLINE_EOF vs. [root@b47d695a1c20 /]# rpm --eval "%sysusers_create_package mock %{_sysusersdir}/mock.conf" systemd-sysusers --replace=/usr/lib/sysusers.d/mock.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : #Type Name ID GECOS Home directory Shell g mock 135 - SYSTEMD_INLINE_EOF [root@b47d695a1c20 /]#
In the macros.systemd file there is the following example: # Example: # Source1: %{name}-sysusers.conf # ... # %install # install -D %SOURCE1 %{buildroot}%{_sysusersdir}/%{name}.conf # %pre # %sysusers_create_package %{name} %SOURCE1 # %files # %{_sysusersdir}/%{name}.conf That works for the case where the sysusers file is in dist-git. If it part of the tarball, this doesn't work because the file is not available when the spec file is evaluated. I don't have a nice solution for this atm. Maybe simply copy the file to dist-git so that it's available early enough?
Hmm, while it is technically possible, I do not think it is feasible. Especially if we want to replace all those groupadd and useradd pre scriptlets. Normal getent group mock > /dev/null || groupadd -f -g %mockgid -r mock sounds better to me. If the file really have to be in dist-git, then I would highly recommend some common name. E.g., sysusers.conf so the tooling working with dist-git can work with that.
Yes, I don't think sysusers provides a lot of benefit right now except for no dependency on shadow-utils. But that only matters in specific circumstances. Sorry, we have the sysusers story nailed down yet.
OK. I reverted the usage of sysuser back to groupadd. Commit * 8cc7ad8 (HEAD -> devel) revert sysusers setting [RHBZ#1740545]
@Mirek, can you please backport this *now* to Fedora? This bug broke the CI for KIWI[1], and every attempt I've made to fix it seems to be failing... [1]: https://github.com/OSInside/kiwi
*** Bug 1745506 has been marked as a duplicate of this bug. ***
@Neal it is coming...
FEDORA-EPEL-2019-8d0e9a723b has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-8d0e9a723b
FEDORA-EPEL-2019-55d57a78af has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-55d57a78af
FEDORA-2019-86ede7b802 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-86ede7b802
mock-core-configs-31.2-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-55d57a78af
For the record, mock-core-configs-31.1-1.fc30 also broke Silverblue 30 rpm-ostree updates with layered mock: $ rpm-ostree uninstall fedpkg : Processing packages... done Running pre scripts... done Running post scripts... done error: While applying overrides for pkg mock-core-configs: Could not find group 'mock' in group file
Well that was the wrong output I posted above: s/uninstall fedpkg/update/ . But same story: $ rpm-ostree update : Updating metadata for 'updates'... done rpm-md repo 'updates'; generated: 2019-08-26T00:39:22Z Importing rpm-md... done Resolving dependencies... done Applying 1 override and 242 overlays Processing packages... done Running pre scripts... done Running post scripts... done error: While applying overrides for pkg mock-core-configs: Could not find group 'mock' in group file
mock-core-configs-31.2-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-86ede7b802
mock-core-configs-31.2-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-f93ae1fa92
mock-core-configs-31.2-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-8d0e9a723b
mock-core-configs-31.2-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.
mock-core-configs-31.2-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.
mock-core-configs-31.2-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
FEDORA-EPEL-2019-373a10878c has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-373a10878c
mock-core-configs-31.3-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-373a10878c
FEDORA-EPEL-2019-5a872caba8 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-5a872caba8
mock-core-configs-31.4-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-5a872caba8
FEDORA-EPEL-2019-eab983bd46 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-eab983bd46
distribution-gpg-keys-1.35-1.el8, mock-core-configs-31.5-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-eab983bd46
distribution-gpg-keys-1.35-1.el8, mock-core-configs-31.5-1.el8 has been pushed to the Fedora EPEL 8 stable repository. If problems still persist, please make note of it in this bug report.