From d4061baee860355f02605913c46e4f17e9645ba3522c35c158ab1105537abb31 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 14 Sep 2023 12:40:59 +0000 Subject: [PATCH 1/7] explicitely enable/disable ukify OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1439 --- systemd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd.spec b/systemd.spec index 31a46215..57b5b060 100644 --- a/systemd.spec +++ b/systemd.spec @@ -782,6 +782,7 @@ export CFLAGS="%{optflags} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" -Doomd=%{when experimental} \ -Drepart=%{when experimental} \ -Dsysupdate=%{when experimental} \ + -Dukify=%{when experimental} \ \ -Dtests=%{when testsuite unsafe} \ -Dinstall-tests=%{when testsuite} From 8acfd11dde9a49e0a1e29a0afa32e25c65299968b3ad86bd92111e6372302cda Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 08:36:42 +0000 Subject: [PATCH 2/7] reword one comment OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1440 --- systemd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemd.spec b/systemd.spec index 57b5b060..46843d60 100644 --- a/systemd.spec +++ b/systemd.spec @@ -933,8 +933,8 @@ touch %{buildroot}%{_localstatedir}/lib/systemd/catalog/database %fdupes -s %{buildroot}%{_mandir} -# Make sure to disable all services by default. The SUSE branding presets -# package takes care of defining the right policies. +# Make sure to disable all services by default. The branding presets package +# takes care of defining the SUSE policies. rm -f %{buildroot}%{_presetdir}/*.preset echo 'disable *' >%{buildroot}%{_presetdir}/99-default.preset echo 'disable *' >%{buildroot}%{_userpresetdir}/99-default.preset From 7cfb2ae59ec2f4eb4da8d1006474bc474d270b446a38f1c9801f7bf7207b19e6 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 14:28:05 +0000 Subject: [PATCH 3/7] - systemd.spec: when enabling units prefer enabling service units over socket ones for socket activable services. The services shipped by systemd automatically redirect the enablement request to the socket unit. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1441 --- systemd.changes | 7 +++++++ systemd.spec | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/systemd.changes b/systemd.changes index 1375f760..0b369f59 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Sep 22 14:23:38 UTC 2023 - Franck Bui + +- systemd.spec: when enabling units prefer enabling service units over socket + ones for socket activable services. The services shipped by systemd + automatically redirect the enablement request to the socket unit. + ------------------------------------------------------------------- Thu Sep 14 06:33:05 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 46843d60..07fe64f0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1017,7 +1017,7 @@ if [ $1 -gt 1 ]; then %systemd_pre getty@.service %systemd_pre systemd-timesyncd.service %systemd_pre systemd-journald-audit.socket - %systemd_pre systemd-userdbd.socket + %systemd_pre systemd-userdbd.service fi %post @@ -1061,7 +1061,7 @@ if [ $1 -gt 1 ]; then %systemd_post getty@.service %systemd_post systemd-timesyncd.service %systemd_post systemd-journald-audit.socket - %systemd_post systemd-userdbd.socket + %systemd_post systemd-userdbd.service fi # Run the hacks/fixups to clean up the old stuff left by (very) old versions of @@ -1160,26 +1160,26 @@ fi %if %{with journal_remote} %pre journal-remote -%systemd_pre systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%systemd_pre systemd-journal-remote.socket systemd-journal-remote.service +%systemd_pre systemd-journal-gatewayd.service +%systemd_pre systemd-journal-remote.service %systemd_pre systemd-journal-upload.service %post journal-remote # Assume that all files shipped by systemd-journal-remove are owned by root. %sysusers_create systemd-remote.conf -%systemd_post systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%systemd_post systemd-journal-remote.socket systemd-journal-remote.service +%systemd_post systemd-journal-gatewayd.service +%systemd_post systemd-journal-remote.service %systemd_post systemd-journal-upload.service %preun journal-remote -%systemd_preun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%systemd_preun systemd-journal-remote.socket systemd-journal-remote.service +%systemd_preun systemd-journal-gatewayd.service +%systemd_preun systemd-journal-remote.service %systemd_preun systemd-journal-upload.service %postun journal-remote -%systemd_postun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%systemd_postun systemd-journal-remote.socket systemd-journal-remote.service -%systemd_postun systemd-journal-upload.service +%systemd_postun_with_restart systemd-journal-gatewayd.service +%systemd_postun_with_restart systemd-journal-remote.service +%systemd_postun_with_restart systemd-journal-upload.service %endif %if %{with networkd} || %{with resolved} From 4553b1a7f34695352a1de326bfef624987428e69d0e1cb70a593b464fe140732 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 14:43:05 +0000 Subject: [PATCH 4/7] timesyncd is shipped in udev, move the related calls to %systemd_* in the udev scriptlets OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1442 --- systemd.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systemd.spec b/systemd.spec index 07fe64f0..629325a2 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1015,7 +1015,6 @@ if [ $1 -gt 1 ]; then # 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 %systemd_pre systemd-userdbd.service fi @@ -1059,7 +1058,6 @@ 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 %systemd_post systemd-userdbd.service fi @@ -1071,7 +1069,6 @@ fi %postun # Avoid restarting logind until fixed upstream (issue #1163) %systemd_postun_with_restart systemd-journald.service -%systemd_postun_with_restart systemd-timesyncd.service %systemd_postun_with_restart systemd-userdbd.service %pre -n udev%{?mini} @@ -1079,6 +1076,7 @@ fi # setting. %systemd_pre remote-cryptsetup.target %systemd_pre systemd-pstore.service +%systemd_pre systemd-timesyncd.service # New installations uses the last compat symlink generation number (currently at # 2), which basically disables all compat symlinks. On old systems, the file @@ -1097,6 +1095,7 @@ fi %endif %systemd_post remote-cryptsetup.target %systemd_post systemd-pstore.service +%systemd_post systemd-timesyncd.service %preun -n udev%{?mini} %systemd_preun systemd-udevd.service systemd-udevd-{control,kernel}.socket @@ -1120,6 +1119,7 @@ fi # frame where no socket will be listening to the events sent by the kernel, no # matter if the socket unit is restarted in first or not. %systemd_postun_with_restart systemd-udevd.service systemd-udevd-{control,kernel}.socket +%systemd_postun_with_restart systemd-timesyncd.service %systemd_postun systemd-pstore.service %posttrans -n udev%{?mini} From c92f800b3c6660e7137c0941b94409f412e113b95b15ef61fe3904c30f6c59d4 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 14:46:21 +0000 Subject: [PATCH 5/7] add missing '%systemd_preun systemd-timesyncd.service' OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1443 --- systemd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd.spec b/systemd.spec index 629325a2..85967108 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1100,6 +1100,7 @@ fi %preun -n udev%{?mini} %systemd_preun systemd-udevd.service systemd-udevd-{control,kernel}.socket %systemd_preun systemd-pstore.service +%systemd_preun systemd-timesyncd.service %postun -n udev%{?mini} %regenerate_initrd_post From bac4d989f28dc4b79466ccab7b4243fb0d1538a9d834a71493e1c29defb4035f Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 15:05:44 +0000 Subject: [PATCH 6/7] - systemd.spec: during package updates, restart localed, timedated and hostnamed if they're running. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1444 --- systemd.changes | 6 ++++++ systemd.spec | 3 +++ 2 files changed, 9 insertions(+) diff --git a/systemd.changes b/systemd.changes index 0b369f59..d44953c0 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 22 15:04:54 UTC 2023 - Franck Bui + +- systemd.spec: during package updates, restart localed, timedated and hostnamed + if they're running. + ------------------------------------------------------------------- Fri Sep 22 14:23:38 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 85967108..ba707727 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1068,7 +1068,10 @@ fi %postun # Avoid restarting logind until fixed upstream (issue #1163) +%systemd_postun_with_restart systemd-hostnamed.service %systemd_postun_with_restart systemd-journald.service +%systemd_postun_with_restart systemd-localed.service +%systemd_postun_with_restart systemd-timedated.service %systemd_postun_with_restart systemd-userdbd.service %pre -n udev%{?mini} From 0545884627868c52dd9c825279bfb20354285fd3636594cf2e3e03d39a169808 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 22 Sep 2023 15:25:11 +0000 Subject: [PATCH 7/7] for consistency with the other sub-packages, always run %systemd_{pre,post} for the main package OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1445 --- systemd.spec | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/systemd.spec b/systemd.spec index ba707727..652e70df 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1008,16 +1008,15 @@ rm -fr %{buildroot}%{_docdir}/systemd # 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. %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-journald-audit.socket - %systemd_pre systemd-userdbd.service -fi +# We don't really need to enable these units explicitely since during +# installation `systemctl preset-all` is executed at the end of the install +# transaction by the branding preset package. However it might be needed when +# upgrading from a previous version of systemd that didn't ship one of these +# units. +%systemd_pre remote-fs.target +%systemd_pre getty@.service +%systemd_pre systemd-journald-audit.socket +%systemd_pre systemd-userdbd.service %post if [ $1 -eq 1 ]; then @@ -1054,13 +1053,11 @@ 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-journald-audit.socket - %systemd_post systemd-userdbd.service -fi +# See the comment in %%pre about why we need to call %%systemd_pre. +%systemd_post remote-fs.target +%systemd_post getty@.service +%systemd_post systemd-journald-audit.socket +%systemd_post systemd-userdbd.service # Run the hacks/fixups to clean up the old stuff left by (very) old versions of # systemd.