From aad635c696cdf3496cd7755b0adbfedabcf80239d51ff5d5559169a7fe2950e9 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 31a4621..57b5b06 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 27eee28d7f56b7556261f8bde8149287b9477755bf4c513efa0e60033e65aac3 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 57b5b06..46843d6 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 f4d03437ea9639a5296c684363fb42f9d21577b4c33806bc77c5a20ba14a2194 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 1375f76..0b369f5 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 46843d6..07fe64f 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 1d98c5720f4a735607f367877500a05317bf0f40db1921cc1aa378bb47d9cc3f 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 07fe64f..629325a 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 1a144ba2364693039c081813861d735ef058cab01191f017804eaa1085325ef6 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 629325a..8596710 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 8ebd5d71639eb6a9ff88fafc426bb021291fa33d19d7b23a0731dfc6cb7810a7 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 0b369f5..d44953c 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 8596710..ba70772 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 489dc84efacc72a11493b4153ac7ad612804353cdceff5be626f6814ea7c5208 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 ba70772..652e70d 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.