3a29c7c
@@ -31,7 +31,8 @@
rm -fv /usr/bin/pinky
# we lose presets by removing /usr/lib/systemd but we do not care
- rm -rfv /usr/lib/systemd
+ # we keep libraries for systemctl
+ rm -rfv /usr/lib/systemd/[^l]*
# if you want to change the timezone, bind-mount it from the host or reinstall tzdata
rm -fv /etc/localtime
systemctl relies on the shared libsystemd library in /usr/lib/systemd; deleting that results in
/usr/bin/systemctl: error while loading shared libraries: libsystemd-shared-245.so: cannot open shared object file: No such file or directory
every time systemctl runs (e.g. from RPM scripts).
This changes the /usr/lib/systemd clean-up to preserve anything starting with l (which is only libsystemd-shared-XXX.so currently).
Signed-off-by: Stephen Kitt skitt@redhat.com
Surely we should exclude appropriate packages rather than randomly "rm -rf " stuff so that we don't get these issues, and they would all just come back with a package update anyway
Agreed, but I’m just trying to fix a small issue in the existing images rather than re-doing them entirely ;-).
@dustymabe you made the orig change here? Shall we just exclude this?
AFAIU systemd isn't including in the minimal container image so I'm not sure if this would have the effect that @skitt is looking for. I just grabbed registry.fedoraprojec.org/33/fedora-minimal and here is what is shown as missing as a result of the rm command:
registry.fedoraprojec.org/33/fedora-minimal
rm
bash-5.0# rpm -q systemd package systemd is not installed bash-5.0# rpm -qaV | grep missing | grep systemd missing /usr/lib/systemd/system-preset missing /usr/lib/systemd/system-preset/85-display-manager.preset missing /usr/lib/systemd/system-preset/90-default.preset missing /usr/lib/systemd/system-preset/99-default-disable.preset missing /usr/lib/systemd/user-preset missing /usr/lib/systemd/user-preset/90-default-user.preset missing /usr/lib/systemd/user-preset/99-default-disable.preset missing /usr/lib/systemd/user/dirmngr.service missing /usr/lib/systemd/user/dirmngr.socket missing /usr/lib/systemd/user/gpg-agent-browser.socket missing /usr/lib/systemd/user/gpg-agent-extra.socket missing /usr/lib/systemd/user/gpg-agent-ssh.socket missing /usr/lib/systemd/user/gpg-agent.service missing /usr/lib/systemd/user/gpg-agent.socket missing /usr/lib/systemd/system/pam_namespace.service missing /usr/lib/systemd/system/rpmdb-rebuild.service missing /usr/lib/systemd/system/fstrim.service missing /usr/lib/systemd/system/fstrim.timer
To peter's point we could probably stop removing those files, but if systemd isn't in the container at all then they really aren't needed. I could go either way.
Ah that’s a good point @dustymabe, I ran into the issue on images built before ed48111. Now that systemd isn’t in the base image, installing a package which depends on it will result on a complete installation, including the library.
ed48111 refers to https://pagure.io/fedora-kickstarts/c/ed48111a5b011edc4249dd25c231574b1a689f99
Pull-Request has been closed by skitt
systemctl relies on the shared libsystemd library in /usr/lib/systemd;
deleting that results in
/usr/bin/systemctl: error while loading shared libraries: libsystemd-shared-245.so: cannot open shared object file: No such file or directory
every time systemctl runs (e.g. from RPM scripts).
This changes the /usr/lib/systemd clean-up to preserve anything
starting with l (which is only libsystemd-shared-XXX.so currently).
Signed-off-by: Stephen Kitt skitt@redhat.com