From 4c9544f7cedb821f3ede514acf1cc6ee41bf811f Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Tue, 12 Nov 2024 08:56:51 +0100 Subject: [PATCH] systemd-256-17 Resolves: RHEL-60896 --- ...t-activation-of-stopped-services-wit.patch | 53 +++++++++++++++++++ systemd.spec | 6 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0098-socket-fix-socket-activation-of-stopped-services-wit.patch diff --git a/0098-socket-fix-socket-activation-of-stopped-services-wit.patch b/0098-socket-fix-socket-activation-of-stopped-services-wit.patch new file mode 100644 index 0000000..ddc86c5 --- /dev/null +++ b/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/systemd.spec b/systemd.spec index 3331064..9415df9 100644 --- a/systemd.spec +++ b/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: 17%{?dist} %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?) @@ -205,6 +205,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) @@ -1139,6 +1140,9 @@ rm -f .file-list-* rm -f %{name}.lang %changelog +* 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