This reverts commit 57e13a1b8970c2e15d0c310aa871e4737781a23f. I noticed that systemd-logind was causing problems in our containers after a container rebuild of the f32 base image was published about 5 days ago. I found that an issue[0] had been filed about the problem, but that bug was reported against Rawhide (f33). I then found that systemd had been removed from the f32 base image after f32 was released. This causes problems for users who expect stability out of Fedora releases - changing the default package set means that a container build that works one day can break the next. In our case, the problem wasn't so much that systemd was removed, but that the unit masks were removed. This causes some components of systemd to be unable to function in a container, and puts a burden on users to identify the problem. https://pagure.io/releng/issue/9603 [0] https://bugzilla.redhat.com/show_bug.cgi?id=1841139
66 lines
2.2 KiB
Plaintext
66 lines
2.2 KiB
Plaintext
# See fedora-container-common.ks for details on how to hack on container image kickstarts
|
|
# This base is a standard Fedora image with python3 and dnf
|
|
|
|
%include fedora-container-common.ks
|
|
|
|
%packages --excludedocs --instLangs=en --nocore --excludeWeakdeps
|
|
rootfiles
|
|
# https://communityblog.fedoraproject.org/modularity-dead-long-live-modularity/
|
|
fedora-repos-modular
|
|
tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920
|
|
vim-minimal
|
|
dnf
|
|
dnf-yum # https://fedorahosted.org/fesco/ticket/1312#comment:29
|
|
sssd-client
|
|
sudo
|
|
-glibc-langpack-en
|
|
-cracklib-dicts
|
|
-langpacks-en
|
|
%end
|
|
|
|
%post --erroronfail --log=/root/anaconda-post.log
|
|
# remove some extraneous files
|
|
rm -rf /var/cache/dnf/*
|
|
rm -rf /tmp/*
|
|
|
|
# https://pagure.io/atomic-wg/issue/308
|
|
printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1576993
|
|
systemctl disable dnf-makecache.timer
|
|
|
|
#Mask mount units and getty service so that we don't get login prompt
|
|
systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1343138
|
|
# Fix /run/lock breakage since it's not tmpfs in docker
|
|
# This unmounts /run (tmpfs) and then recreates the files
|
|
# in the /run directory on the root filesystem of the container
|
|
#
|
|
# We ignore the return code of the systemd-tmpfiles command because
|
|
# at this point we have already removed the /etc/machine-id and all
|
|
# tmpfiles lines with %m in them will fail and cause a bad return
|
|
# code. Example failure:
|
|
# [/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /run/log/journal/%m
|
|
#
|
|
umount /run
|
|
systemd-tmpfiles --prefix=/run/ --prefix=/var/run/ --create --boot || true
|
|
rm /run/nologin # https://pagure.io/atomic-wg/issue/316
|
|
|
|
# Final pruning
|
|
rm -rfv /var/cache/* /var/log/* /tmp/*
|
|
|
|
%end
|
|
|
|
%post --nochroot --erroronfail --log=/mnt/sysimage/root/anaconda-post-nochroot.log
|
|
set -eux
|
|
|
|
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816
|
|
# NOTE: run this in nochroot because "find" does not exist in chroot
|
|
KEEPLANG=en_US
|
|
for dir in locale i18n; do
|
|
find /mnt/sysimage/usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rfv {} +
|
|
done
|
|
|
|
%end
|