diff --git a/systemd.changes b/systemd.changes index 6fd273e3..16ab984f 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue May 2 10:34:43 UTC 2023 - Franck Bui + +- Revert changes that dropped calls to %systemd_{pre,post} in the main package + + Until we switch to filetriggers these calls are needed when a new version of + systemd introduced a new config file during an update. + +- We also introduce a new build conditional "%filetriggers" to identify easily + which parts of the code will become obsolete when we'll switch to file + triggers (WIP). This is important as this is unlikely to happen on SLE. + ------------------------------------------------------------------- Fri Apr 28 10:43:02 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 29e9f363..1b971cd7 100644 --- a/systemd.spec +++ b/systemd.spec @@ -68,6 +68,7 @@ %bcond_without testsuite %endif # Kept to ease migrations toward SLE +%bcond_with filetriggers %bcond_with split_usr Name: systemd%{?mini} @@ -964,13 +965,17 @@ tar -cO \ # Don't drop %%pre section even if it becomes empty: the build process of # installation images uses a hardcoded list of packages with a %%pre that needs # to be run during the build and complains if it can't find one. -# -# Note: presets for units shipped by the main package are applied by %%posttrans -# scripts of systemd-presets-common-SUSE. Hence we don't need to bother running -# %%systemd_{pre,post} on them, which is fortunate since the helper script the -# systemd rpm macros rely on is not yet installed. %pre -: +if [ $1 -gt 1 ]; then + # We keep these just in case we're upgrading from an old version that + # was missing one of these units. During package installation, these + # macros are NOPs for the main package (the branding preset package + # takes care of applying the presets in its %%posttrans in this case). + %systemd_pre remote-fs.target + %systemd_pre getty@.service + %systemd_pre systemd-timesyncd.service + %systemd_pre systemd-journald-audit.socket +fi %post # Make /etc/machine-id an empty file during package installation. On the first @@ -995,12 +1000,6 @@ pam-config --add --systemd || : %ldconfig %endif -# systemd-sysusers is not available in %pre so this needs to be done in -# %%post. However this shouldn't be an issue since all files the main package -# ships are owned by root. -%sysusers_create systemd-journal.conf -%sysusers_create systemd-timesync.conf - systemctl daemon-reexec || : # Reexecute user manager instances (if any). It is asynchronous but it shouldn't @@ -1017,13 +1016,28 @@ systemctl daemon-reexec || : # # systemctl kill --kill-who=main --signal=SIGRTMIN+25 "user@*.service" || : -if [ "$1" -eq 1 ]; then +if [ $1 -eq 1 ]; then # Persistent journal is the default mkdir -p %{_localstatedir}/log/journal fi -%journal_catalog_update -%tmpfiles_create +%if %{without filetriggers} +# During package installation, the followings are for config files shipped by +# packages that got installed before systemd and by the systemd main package +# itself. During update they deal with files that could have been introduced by +# new versions of systemd. +systemd-sysusers || : +systemd-tmpfiles --create || : +journalctl --update-catalog || : +%endif + +if [ $1 -gt 1 ]; then + # See comments for %%systemd_pre in %%pre. + %systemd_post remote-fs.target + %systemd_post getty@.service + %systemd_post systemd-timesyncd.service + %systemd_post systemd-journald-audit.socket +fi # v228 wrongly set world writable suid root permissions on timestamp files used # by permanent timers. Fix the timestamps that might have been created by the