From 958f5e240cff19611641aa767fd6250ec24dd600effed56f9840b10f4a40b50d Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 27 Apr 2023 16:27:42 +0000 Subject: [PATCH] - systemd.spec: don't call %systemd_{pre,post} on units shipped by the main package since they don't have any effect during installation (systemctl is not yet installed when %pre script is executed). This is actually the reason why it's handled by the %%posttrans scripts of systemd-presets-common-SUSE. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1376 --- systemd.changes | 8 ++++++++ systemd.spec | 19 ++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/systemd.changes b/systemd.changes index 7f3a9fae..5490e70d 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Apr 27 16:15:57 UTC 2023 - Franck Bui + +- systemd.spec: don't call %systemd_{pre,post} on units shipped by the main + package since they don't have any effect during installation (systemctl is not + yet installed when %pre script is executed). This is actually the reason why + it's handled by the %%posttrans scripts of systemd-presets-common-SUSE. + ------------------------------------------------------------------- Thu Apr 27 07:58:58 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index ef65a499..29e9f363 100644 --- a/systemd.spec +++ b/systemd.spec @@ -964,13 +964,13 @@ 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 -# Units listed below can be enabled at installation according to their preset -# setting. -%systemd_pre remote-fs.target -%systemd_pre getty@.service -%systemd_pre systemd-timesyncd.service -%systemd_pre systemd-journald-audit.socket +: %post # Make /etc/machine-id an empty file during package installation. On the first @@ -1025,13 +1025,6 @@ fi %journal_catalog_update %tmpfiles_create -# Units listed below can be enabled at installation accoding to their preset -# setting. -%systemd_post remote-fs.target -%systemd_post getty@.service -%systemd_post systemd-timesyncd.service -%systemd_post systemd-journald-audit.socket - # 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 # affected versions of systemd (bsc#1020601).