From e507530bd38d0731174328985146854033f02f62 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 6 Dec 2024 09:44:16 +0300 Subject: [PATCH] import systemd-256-18.el10 --- ...t-activation-of-stopped-services-wit.patch | 53 +++++++++++++++++++ SOURCES/rc.local | 13 +++++ SOURCES/split-files.py | 2 + SOURCES/systemd-resolved.sysusers | 8 +++ SPECS/systemd.spec | 25 +++++++-- 5 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 SOURCES/0098-socket-fix-socket-activation-of-stopped-services-wit.patch create mode 100644 SOURCES/rc.local create mode 100644 SOURCES/systemd-resolved.sysusers diff --git a/SOURCES/0098-socket-fix-socket-activation-of-stopped-services-wit.patch b/SOURCES/0098-socket-fix-socket-activation-of-stopped-services-wit.patch new file mode 100644 index 0000000..ddc86c5 --- /dev/null +++ b/SOURCES/0098-socket-fix-socket-activation-of-stopped-services-wit.patch @@ -0,0 +1,53 @@ +From e20fddc3c5769ad1babb24392500264de6db59b6 Mon Sep 17 00:00:00 2001 +From: Michal Sekletar +Date: Tue, 30 Jul 2024 16:22:03 +0200 +Subject: [PATCH] socket: fix socket activation of stopped services with pinned + FD store + +(cherry picked from commit 941a12dcba57f6673230a9c413738c51374d2998) + +Resolves: RHEL-60896 +--- + src/core/socket.c | 4 ++-- + .../units/TEST-04-JOURNAL.stopped-socket-activation.sh | 10 ++++++++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + create mode 100755 test/units/TEST-04-JOURNAL.stopped-socket-activation.sh + +diff --git a/src/core/socket.c b/src/core/socket.c +index 41147d4bf7..0694fe7aad 100644 +--- a/src/core/socket.c ++++ b/src/core/socket.c +@@ -2481,7 +2481,7 @@ static int socket_start(Unit *u) { + /* If the service is already active we cannot start the + * socket */ + if (!IN_SET(service->state, +- SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART, ++ SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_DEAD_RESOURCES_PINNED, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART, + SERVICE_AUTO_RESTART, SERVICE_AUTO_RESTART_QUEUED)) + return log_unit_error_errno(u, SYNTHETIC_ERRNO(EBUSY), + "Socket service %s already active, refusing.", UNIT(service)->id); +@@ -3369,7 +3369,7 @@ static void socket_trigger_notify(Unit *u, Unit *other) { + return; + + if (IN_SET(SERVICE(other)->state, +- SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART, ++ SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_DEAD_RESOURCES_PINNED, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART, + SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL, + SERVICE_AUTO_RESTART, SERVICE_AUTO_RESTART_QUEUED)) + socket_enter_listening(s); +diff --git a/test/units/TEST-04-JOURNAL.stopped-socket-activation.sh b/test/units/TEST-04-JOURNAL.stopped-socket-activation.sh +new file mode 100755 +index 0000000000..083f5fa055 +--- /dev/null ++++ b/test/units/TEST-04-JOURNAL.stopped-socket-activation.sh +@@ -0,0 +1,10 @@ ++#!/usr/bin/env bash ++# SPDX-License-Identifier: LGPL-2.1-or-later ++set -eux ++set -o pipefail ++ ++systemctl stop systemd-journald.service ++systemd-cat date ++ ++# shellcheck disable=SC2016 ++timeout 30 bash -xec 'until test "$(systemctl show -p SubState --value systemd-journald.service)" = "running"; do sleep 1; done' diff --git a/SOURCES/rc.local b/SOURCES/rc.local new file mode 100644 index 0000000..a7e0ad2 --- /dev/null +++ b/SOURCES/rc.local @@ -0,0 +1,13 @@ +#!/bin/bash +# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES +# +# It is highly advisable to create own systemd services or udev rules +# to run scripts during boot instead of using this file. +# +# In contrast to previous versions due to parallel execution during boot +# this script will NOT be run after all other services. +# +# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure +# that this script will be executed during boot. + +touch /var/lock/subsys/local diff --git a/SOURCES/split-files.py b/SOURCES/split-files.py index 5337c1a..8f7079f 100644 --- a/SOURCES/split-files.py +++ b/SOURCES/split-files.py @@ -22,6 +22,8 @@ known_files = ''' %ghost %config(noreplace) /etc/locale.conf %ghost %attr(0444,root,root) %config(noreplace) /etc/machine-id %ghost %config(noreplace) /etc/machine-info +%config(noreplace) %{_sysconfdir}/rc.d/rc.local +%{_sysconfdir}/rc.local %ghost %attr(0700,root,root) %dir /var/cache/private %ghost %attr(0700,root,root) %dir /var/lib/private %ghost %dir /var/lib/private/systemd diff --git a/SOURCES/systemd-resolved.sysusers b/SOURCES/systemd-resolved.sysusers new file mode 100644 index 0000000..37ccb7a --- /dev/null +++ b/SOURCES/systemd-resolved.sysusers @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-resolve 193 "systemd Resolver" \ No newline at end of file diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 4a00a95..bb57491 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -48,7 +48,7 @@ Url: https://systemd.io # Allow users to specify the version and release when building the rpm by # setting the %%version_override and %%release_override macros. Version: %{?version_override}%{!?version_override:256} -Release: 16%{?dist} +Release: 18%{?dist} %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?) @@ -93,6 +93,9 @@ Source24: sysusers.generate-pre.sh Source25: 98-default-mac-none.link +Source26: rc.local +Source27: systemd-resolved.sysusers + %if 0 GIT_DIR=../../src/systemd/.git git format-patch-ab --no-signature -M -N v235..v235-stable i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done|xclip @@ -203,6 +206,7 @@ Patch0094: 0094-confidential-virt-split-caching-of-CVM-detection-int.patch Patch0095: 0095-confidential-virt-add-detection-for-s390x-target.patch Patch0096: 0096-man-systemd-detect-virt-fix-row-spanning-for-VM-head.patch Patch0097: 0097-man-systemd-detect-virt-list-known-CVM-technologies.patch +Patch0098: 0098-socket-fix-socket-activation-of-stopped-services-wit.patch # Downstream-only patches (9000–9999) @@ -589,8 +593,8 @@ License: LGPL-2.1-or-later %description container Systemd tools to spawn and manage containers and virtual machines. -This package contains systemd-nspawn, machinectl, -systemd-machined, and systemd-importd. +This package contains systemd-nspawn, machinectl, systemd-machined, +and systemd-importd. %package journal-remote # Name is the same as in Debian @@ -618,6 +622,7 @@ Obsoletes: %{name} < 249~~ Requires: libidn2.so.0%{?elf_suffix} Requires: libidn2.so.0(IDN2_0.0.0)%{?elf_bits} Requires(posttrans): grep +%{?sysusers_requires_compat} %description resolved systemd-resolved is a system service that provides network name resolution to @@ -869,6 +874,11 @@ touch %{buildroot}%{_sysconfdir}/udev/hwdb.bin touch %{buildroot}%{_localstatedir}/lib/systemd/random-seed touch %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload/state +# Install rc.local +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/ +install -m 0644 %{SOURCE26} %{buildroot}%{_sysconfdir}/rc.d/rc.local +ln -s rc.d/rc.local %{buildroot}%{_sysconfdir}/rc.local + # Install yum protection fragment install -Dm0644 %{SOURCE5} %{buildroot}/etc/dnf/protected.d/systemd.conf @@ -1040,6 +1050,9 @@ fi %systemd_postun_with_restart %journal_remote_units_restart %firewalld_reload +%pre resolved +%sysusers_create_compat %{SOURCE27} + %post resolved %systemd_post systemd-resolved.service @@ -1132,6 +1145,12 @@ rm -f .file-list-* rm -f %{name}.lang %changelog +* Tue Nov 19 2024 systemd maintenance team - 256-18 +- add %%pre sysuser scriptlet for resolved subpackage (RHEL-50564) + +* Tue Nov 12 2024 systemd maintenance team - 256-17 +- socket: fix socket activation of stopped services with pinned FD store (RHEL-60896) + * Tue Oct 29 2024 Troy Dawson - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018