From 0345c83b5000ba26dab83515891b00c3b319786c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 13 Sep 2020 11:02:40 +0200 Subject: [PATCH 01/16] Version 246.5 --- sources | 2 +- systemd.spec | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 2191a34..cd75eb4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (systemd-246.4.tar.gz) = f01c25defa85c3b5373b41cdfb3e940026915ec3bcd0142526be915fc79d41c7456df47128f282ede111d977bd99e93211efa45a8a7d82520622681b3e135de7 +SHA512 (systemd-246.5.tar.gz) = 4006b81b03a806135178f044162db598a16d6dc1c6048229a36eadbed87f5ca3a92e3fab773d0b55a6dbbd7b1a68a978ae3a2c96bad42eb034bdd4d469659e52 diff --git a/systemd.spec b/systemd.spec index fb657e4..a6755b4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -19,7 +19,7 @@ Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd -Version: 246.4 +Version: 246.5 Release: 1%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ @@ -804,6 +804,11 @@ fi %files tests -f .file-list-tests %changelog +* Sun Sep 13 2020 Zbigniew Jędrzejewski-Szmek - 246.5-1 +- Update to latest stable release (a bunch of small network-related + fixes in systemd-networkd and socket handling, documentation updates, + a bunch of fixes for error handling). + * Wed Sep 2 2020 Zbigniew Jędrzejewski-Szmek - 246.4-1 - Update to latest stable version: a rework of how the unit cache mtime works (hopefully #1872068, #1871327, #1867930), plus various fixes to From 04b6e059f78906c591248d97229d876d5bb9925b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 13 Sep 2020 11:03:33 +0200 Subject: [PATCH 02/16] Force creation of /etc/resolv.conf symlink during installation https://bugzilla.redhat.com/show_bug.cgi?id=1873856#c14 --- systemd.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/systemd.spec b/systemd.spec index a6755b4..05af082 100644 --- a/systemd.spec +++ b/systemd.spec @@ -602,12 +602,12 @@ setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ &>/de [ $1 -eq 1 ] || exit 0 -# Create /etc/resolv.conf symlink -# We would also create it using tmpfiles, but let's do this here too -# before NetworkManager gets a chance. (systemd-tmpfiles invocation above +# Create /etc/resolv.conf symlink. +# We would also create it using tmpfiles, but let's do this here unconditionally +# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above # does not do this, because it's marked with ! and we don't specify --boot.) # https://bugzilla.redhat.com/show_bug.cgi?id=1873856 -ln -sv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf +ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf # We reset the enablement of all services upon initial installation # https://bugzilla.redhat.com/show_bug.cgi?id=1118740#c23 @@ -808,6 +808,8 @@ fi - Update to latest stable release (a bunch of small network-related fixes in systemd-networkd and socket handling, documentation updates, a bunch of fixes for error handling). +- Also remove existing file when creating /etc/resolv.conf symlink + upon installation (#1873856 again) * Wed Sep 2 2020 Zbigniew Jędrzejewski-Szmek - 246.4-1 - Update to latest stable version: a rework of how the unit cache mtime works From 269358bd5eeef01fb336e77cda692c51f1fe821c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 14 Sep 2020 09:19:02 +0200 Subject: [PATCH 03/16] One more debugging patch --- ...test-path-more-debugging-information.patch | 78 +++++++++++++++++++ systemd.spec | 1 + 2 files changed, 79 insertions(+) create mode 100644 0001-test-path-more-debugging-information.patch diff --git a/0001-test-path-more-debugging-information.patch b/0001-test-path-more-debugging-information.patch new file mode 100644 index 0000000..23b6309 --- /dev/null +++ b/0001-test-path-more-debugging-information.patch @@ -0,0 +1,78 @@ +From 6781346769d29612930ffd2a0f4c3fd602026328 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 14 Sep 2020 08:56:28 +0200 +Subject: [PATCH] test-path: more debugging information +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Just to make it easier to grok what happens when test-path fails. +Change printf→log_info so that output is interleaved and not split in two +independent parts in log files. +--- + src/test/test-path.c | 31 ++++++++++++++++++------------- + 1 file changed, 18 insertions(+), 13 deletions(-) + +diff --git a/src/test/test-path.c b/src/test/test-path.c +index 1075f31bc6..218b8a976b 100644 +--- a/src/test/test-path.c ++++ b/src/test/test-path.c +@@ -1,7 +1,6 @@ + /* SPDX-License-Identifier: LGPL-2.1+ */ + + #include +-#include + #include + #include + +@@ -78,32 +77,38 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam + return SERVICE(service_unit); + } + +-static void check_states(Manager *m, Path *path, Service *service, PathState path_state, ServiceState service_state) { ++static void _check_states(unsigned line, ++ Manager *m, Path *path, Service *service, PathState path_state, ServiceState service_state) { + assert_se(m); + assert_se(service); + + usec_t end = now(CLOCK_MONOTONIC) + 30 * USEC_PER_SEC; + +- while (path->result != PATH_SUCCESS || service->result != SERVICE_SUCCESS || +- path->state != path_state || service->state != service_state) { ++ while (path->state != path_state || service->state != service_state || ++ path->result != PATH_SUCCESS || service->result != SERVICE_SUCCESS) { + + assert_se(sd_event_run(m->event, 100 * USEC_PER_MSEC) >= 0); + +- printf("%s: state = %s; result = %s \n", +- UNIT(path)->id, +- path_state_to_string(path->state), +- path_result_to_string(path->result)); +- printf("%s: state = %s; result = %s \n", +- UNIT(service)->id, +- service_state_to_string(service->state), +- service_result_to_string(service->result)); ++ usec_t n = now(CLOCK_MONOTONIC); ++ log_info("line %d: %s: state = %s; result = %s (left: %" PRIi64 ")", ++ line, ++ UNIT(path)->id, ++ path_state_to_string(path->state), ++ path_result_to_string(path->result), ++ end - n); ++ log_info("line %d: %s: state = %s; result = %s", ++ line, ++ UNIT(service)->id, ++ service_state_to_string(service->state), ++ service_result_to_string(service->result)); + +- if (now(CLOCK_MONOTONIC) >= end) { ++ if (n >= end) { + log_error("Test timeout when testing %s", UNIT(path)->id); + exit(EXIT_FAILURE); + } + } + } ++#define check_states(...) _check_states(__LINE__, __VA_ARGS__) + + static void test_path_exists(Manager *m) { + const char *test_path = "/tmp/test-path_exists"; diff --git a/systemd.spec b/systemd.spec index 05af082..4f4953f 100644 --- a/systemd.spec +++ b/systemd.spec @@ -72,6 +72,7 @@ Patch0001: use-bfq-scheduler.patch Patch0002: 0001-Revert-test-path-increase-timeout.patch Patch0003: 0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch +Patch0004: 0001-test-path-more-debugging-information.patch Patch0004: 0001-test-acl-util-output-more-debug-info.patch Patch0005: 0001-Do-not-assert-in-test_add_acls_for_user.patch From 81cd8d4bcff27148fff814ab729dc6fcec60a448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 14 Sep 2020 09:19:52 +0200 Subject: [PATCH 04/16] Fix patch numbering --- 0001-test-path-more-debugging-information.patch | 14 ++++++++++---- systemd.spec | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/0001-test-path-more-debugging-information.patch b/0001-test-path-more-debugging-information.patch index 23b6309..89f4270 100644 --- a/0001-test-path-more-debugging-information.patch +++ b/0001-test-path-more-debugging-information.patch @@ -1,4 +1,4 @@ -From 6781346769d29612930ffd2a0f4c3fd602026328 Mon Sep 17 00:00:00 2001 +From 35fbc6b2db3fda9015ecfaa2a60d1a47de35c583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 14 Sep 2020 08:56:28 +0200 Subject: [PATCH] test-path: more debugging information @@ -14,7 +14,7 @@ independent parts in log files. 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/test/test-path.c b/src/test/test-path.c -index 1075f31bc6..218b8a976b 100644 +index 6c0db53f10..7c32e0948f 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -1,7 +1,6 @@ @@ -25,7 +25,7 @@ index 1075f31bc6..218b8a976b 100644 #include #include -@@ -78,32 +77,38 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam +@@ -78,25 +77,30 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam return SERVICE(service_unit); } @@ -35,7 +35,7 @@ index 1075f31bc6..218b8a976b 100644 assert_se(m); assert_se(service); - usec_t end = now(CLOCK_MONOTONIC) + 30 * USEC_PER_SEC; + usec_t end = now(CLOCK_MONOTONIC) + 2 * USEC_PER_SEC; - while (path->result != PATH_SUCCESS || service->result != SERVICE_SUCCESS || - path->state != path_state || service->state != service_state) { @@ -65,6 +65,12 @@ index 1075f31bc6..218b8a976b 100644 + service_state_to_string(service->state), + service_result_to_string(service->result)); + if (service->state == SERVICE_FAILED) { + log_warning("Failed to start service %s, ignoring: %s/%s", +@@ -106,12 +110,13 @@ static void check_states(Manager *m, Path *path, Service *service, PathState pat + break; + } + - if (now(CLOCK_MONOTONIC) >= end) { + if (n >= end) { log_error("Test timeout when testing %s", UNIT(path)->id); diff --git a/systemd.spec b/systemd.spec index 4f4953f..fedd1a5 100644 --- a/systemd.spec +++ b/systemd.spec @@ -74,8 +74,8 @@ Patch0002: 0001-Revert-test-path-increase-timeout.patch Patch0003: 0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch Patch0004: 0001-test-path-more-debugging-information.patch -Patch0004: 0001-test-acl-util-output-more-debug-info.patch -Patch0005: 0001-Do-not-assert-in-test_add_acls_for_user.patch +Patch0005: 0001-test-acl-util-output-more-debug-info.patch +Patch0006: 0001-Do-not-assert-in-test_add_acls_for_user.patch %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 From de06d8e22ca638e7034586a192720c7012276a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 14 Sep 2020 10:03:26 +0200 Subject: [PATCH 05/16] Rework patches for test-path --- 0001-Revert-test-path-increase-timeout.patch | 2 +- ...-fail-the-test-if-we-fail-to-start-s.patch | 53 ---- ...test-path-more-debugging-information.patch | 14 +- ...-fail-the-test-if-we-fail-to-start-s.patch | 245 ++++++++++++++++++ 0004-test-path-use-Type-exec.patch | 94 +++++++ systemd.spec | 9 +- 6 files changed, 349 insertions(+), 68 deletions(-) delete mode 100644 0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch rename 0001-test-path-more-debugging-information.patch => 0002-test-path-more-debugging-information.patch (86%) create mode 100644 0003-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch create mode 100644 0004-test-path-use-Type-exec.patch diff --git a/0001-Revert-test-path-increase-timeout.patch b/0001-Revert-test-path-increase-timeout.patch index a9c226f..74684f2 100644 --- a/0001-Revert-test-path-increase-timeout.patch +++ b/0001-Revert-test-path-increase-timeout.patch @@ -1,7 +1,7 @@ From a73d30081a13eaeffce87f997726a179ec44d817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 31 Jul 2020 10:50:37 +0200 -Subject: [PATCH 1/2] Revert "test-path: increase timeout" +Subject: [PATCH 1/4] Revert "test-path: increase timeout" This partially reverts commit 500727c220354b81b68ed6667d9a6f0fafe3ba19. diff --git a/0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch b/0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch deleted file mode 100644 index c285891..0000000 --- a/0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch +++ /dev/null @@ -1,53 +0,0 @@ -From a2deeaeaa90d493ef8a2b20656745cd0531a1b30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Fri, 31 Jul 2020 10:36:57 +0200 -Subject: [PATCH 2/2] test-path: do not fail the test if we fail to start some - service - -The test was failing because it couldn't start the service: - -path-modified.service: state = failed; result = exit-code -path-modified.path: state = waiting; result = success -path-modified.service: state = failed; result = exit-code -path-modified.path: state = waiting; result = success -path-modified.service: state = failed; result = exit-code -path-modified.path: state = waiting; result = success -path-modified.service: state = failed; result = exit-code -path-modified.path: state = waiting; result = success -path-modified.service: state = failed; result = exit-code -path-modified.path: state = waiting; result = success -path-modified.service: state = failed; result = exit-code -Failed to connect to system bus: No such file or directory --.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied -path-modified.service: Failed to create cgroup /system.slice/kojid.service/path-modified.service: Permission denied -path-modified.service: Failed to attach to cgroup /system.slice/kojid.service/path-modified.service: No such file or directory -path-modified.service: Failed at step CGROUP spawning /bin/true: No such file or directory -path-modified.service: Main process exited, code=exited, status=219/CGROUP -path-modified.service: Failed with result 'exit-code'. -Test timeout when testing path-modified.path - -Let's just ignore the failure here. Services can occasionally fail to start, -there's not much we can do in that case. ---- - src/test/test-path.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/test/test-path.c b/src/test/test-path.c -index 63b709c8da..6c0db53f10 100644 ---- a/src/test/test-path.c -+++ b/src/test/test-path.c -@@ -98,6 +98,14 @@ static void check_states(Manager *m, Path *path, Service *service, PathState pat - service_state_to_string(service->state), - service_result_to_string(service->result)); - -+ if (service->state == SERVICE_FAILED) { -+ log_warning("Failed to start service %s, ignoring: %s/%s", -+ UNIT(service)->id, -+ service_state_to_string(service->state), -+ service_result_to_string(service->result)); -+ break; -+ } -+ - if (now(CLOCK_MONOTONIC) >= end) { - log_error("Test timeout when testing %s", UNIT(path)->id); - exit(EXIT_FAILURE); diff --git a/0001-test-path-more-debugging-information.patch b/0002-test-path-more-debugging-information.patch similarity index 86% rename from 0001-test-path-more-debugging-information.patch rename to 0002-test-path-more-debugging-information.patch index 89f4270..6aef2dd 100644 --- a/0001-test-path-more-debugging-information.patch +++ b/0002-test-path-more-debugging-information.patch @@ -1,7 +1,7 @@ -From 35fbc6b2db3fda9015ecfaa2a60d1a47de35c583 Mon Sep 17 00:00:00 2001 +From 4c38dcdc8d8f22dddc521faedad6a4f45fa81d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 14 Sep 2020 08:56:28 +0200 -Subject: [PATCH] test-path: more debugging information +Subject: [PATCH 2/4] test-path: more debugging information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,7 +14,7 @@ independent parts in log files. 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/test/test-path.c b/src/test/test-path.c -index 6c0db53f10..7c32e0948f 100644 +index 63b709c8da..84dcf5e37d 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -1,7 +1,6 @@ @@ -25,7 +25,7 @@ index 6c0db53f10..7c32e0948f 100644 #include #include -@@ -78,25 +77,30 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam +@@ -78,32 +77,38 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam return SERVICE(service_unit); } @@ -65,12 +65,6 @@ index 6c0db53f10..7c32e0948f 100644 + service_state_to_string(service->state), + service_result_to_string(service->result)); - if (service->state == SERVICE_FAILED) { - log_warning("Failed to start service %s, ignoring: %s/%s", -@@ -106,12 +110,13 @@ static void check_states(Manager *m, Path *path, Service *service, PathState pat - break; - } - - if (now(CLOCK_MONOTONIC) >= end) { + if (n >= end) { log_error("Test timeout when testing %s", UNIT(path)->id); diff --git a/0003-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch b/0003-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch new file mode 100644 index 0000000..571d85c --- /dev/null +++ b/0003-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch @@ -0,0 +1,245 @@ +From 67c6ff720796bc97f262ba93c6ea87da93b04a1a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 31 Jul 2020 10:36:57 +0200 +Subject: [PATCH 3/4] test-path: do not fail the test if we fail to start some + service + +The test was failing because it couldn't start the service: + +path-modified.service: state = failed; result = exit-code +path-modified.path: state = waiting; result = success +path-modified.service: state = failed; result = exit-code +path-modified.path: state = waiting; result = success +path-modified.service: state = failed; result = exit-code +path-modified.path: state = waiting; result = success +path-modified.service: state = failed; result = exit-code +path-modified.path: state = waiting; result = success +path-modified.service: state = failed; result = exit-code +path-modified.path: state = waiting; result = success +path-modified.service: state = failed; result = exit-code +Failed to connect to system bus: No such file or directory +-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied +path-modified.service: Failed to create cgroup /system.slice/kojid.service/path-modified.service: Permission denied +path-modified.service: Failed to attach to cgroup /system.slice/kojid.service/path-modified.service: No such file or directory +path-modified.service: Failed at step CGROUP spawning /bin/true: No such file or directory +path-modified.service: Main process exited, code=exited, status=219/CGROUP +path-modified.service: Failed with result 'exit-code'. +Test timeout when testing path-modified.path + +In fact any of the services that we try to start may fail, especially +considering that we're doing some rogue cgroup operations. See +https://github.com/systemd/systemd/pull/16603#issuecomment-679133641. +--- + src/test/test-path.c | 88 ++++++++++++++++++++++++++++++-------------- + 1 file changed, 61 insertions(+), 27 deletions(-) + +diff --git a/src/test/test-path.c b/src/test/test-path.c +index 84dcf5e37d..d6c37b77e6 100644 +--- a/src/test/test-path.c ++++ b/src/test/test-path.c +@@ -77,8 +77,8 @@ static Service *service_for_path(Manager *m, Path *path, const char *service_nam + return SERVICE(service_unit); + } + +-static void _check_states(unsigned line, +- Manager *m, Path *path, Service *service, PathState path_state, ServiceState service_state) { ++static int _check_states(unsigned line, ++ Manager *m, Path *path, Service *service, PathState path_state, ServiceState service_state) { + assert_se(m); + assert_se(service); + +@@ -102,11 +102,20 @@ static void _check_states(unsigned line, + service_state_to_string(service->state), + service_result_to_string(service->result)); + ++ if (service->state == SERVICE_FAILED) ++ return log_notice_errno(SYNTHETIC_ERRNO(ECANCELED), ++ "Failed to start service %s, aborting test: %s/%s", ++ UNIT(service)->id, ++ service_state_to_string(service->state), ++ service_result_to_string(service->result)); ++ + if (n >= end) { + log_error("Test timeout when testing %s", UNIT(path)->id); + exit(EXIT_FAILURE); + } + } ++ ++ return 0; + } + #define check_states(...) _check_states(__LINE__, __VA_ARGS__) + +@@ -124,18 +133,22 @@ static void test_path_exists(Manager *m) { + service = service_for_path(m, path, NULL); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(touch(test_path) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + /* Service restarts if file still exists */ + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL) == 0); + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(unit_stop(unit) >= 0); + } +@@ -154,18 +167,22 @@ static void test_path_existsglob(Manager *m) { + service = service_for_path(m, path, NULL); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(touch(test_path) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + /* Service restarts if file still exists */ + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL) == 0); + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(unit_stop(unit) >= 0); + } +@@ -185,23 +202,28 @@ static void test_path_changed(Manager *m) { + service = service_for_path(m, path, NULL); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(touch(test_path) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + /* Service does not restart if file still exists */ + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + f = fopen(test_path, "w"); + assert_se(f); + fclose(f); + +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + (void) rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL); + assert_se(unit_stop(unit) >= 0); +@@ -222,23 +244,28 @@ static void test_path_modified(Manager *m) { + service = service_for_path(m, path, NULL); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(touch(test_path) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + /* Service does not restart if file still exists */ + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + f = fopen(test_path, "w"); + assert_se(f); + fputs("test", f); + +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + (void) rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL); + assert_se(unit_stop(unit) >= 0); +@@ -258,14 +285,17 @@ static void test_path_unit(Manager *m) { + service = service_for_path(m, path, "path-mycustomunit.service"); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(touch(test_path) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL) == 0); + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(unit_stop(unit) >= 0); + } +@@ -286,22 +316,26 @@ static void test_path_directorynotempty(Manager *m) { + assert_se(access(test_path, F_OK) < 0); + + assert_se(unit_start(unit) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + /* MakeDirectory default to no */ + assert_se(access(test_path, F_OK) < 0); + + assert_se(mkdir_p(test_path, 0755) >= 0); + assert_se(touch(strjoina(test_path, "test_file")) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + /* Service restarts if directory is still not empty */ + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING); ++ if (check_states(m, path, service, PATH_RUNNING, SERVICE_RUNNING) < 0) ++ return; + + assert_se(rm_rf(test_path, REMOVE_ROOT|REMOVE_PHYSICAL) == 0); + assert_se(unit_stop(UNIT(service)) >= 0); +- check_states(m, path, service, PATH_WAITING, SERVICE_DEAD); ++ if (check_states(m, path, service, PATH_WAITING, SERVICE_DEAD) < 0) ++ return; + + assert_se(unit_stop(unit) >= 0); + } diff --git a/0004-test-path-use-Type-exec.patch b/0004-test-path-use-Type-exec.patch new file mode 100644 index 0000000..3734dc6 --- /dev/null +++ b/0004-test-path-use-Type-exec.patch @@ -0,0 +1,94 @@ +From 1a83d7234e374e991235f4ef21c56998f93cb875 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 14 Sep 2020 08:58:54 +0200 +Subject: [PATCH 4/4] test-path: use Type=exec + +In general, Type=exec is superior to Type=simple. Let's not assume that +the service is started before it was really started. +--- + test/test-path/path-changed.service | 2 +- + test/test-path/path-directorynotempty.service | 2 +- + test/test-path/path-exists.service | 2 +- + test/test-path/path-existsglob.service | 2 +- + test/test-path/path-makedirectory.service | 2 +- + test/test-path/path-modified.service | 2 +- + test/test-path/path-mycustomunit.service | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/test/test-path/path-changed.service b/test/test-path/path-changed.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-changed.service ++++ b/test/test-path/path-changed.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-directorynotempty.service b/test/test-path/path-directorynotempty.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-directorynotempty.service ++++ b/test/test-path/path-directorynotempty.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-exists.service b/test/test-path/path-exists.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-exists.service ++++ b/test/test-path/path-exists.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-existsglob.service b/test/test-path/path-existsglob.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-existsglob.service ++++ b/test/test-path/path-existsglob.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-makedirectory.service b/test/test-path/path-makedirectory.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-makedirectory.service ++++ b/test/test-path/path-makedirectory.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-modified.service b/test/test-path/path-modified.service +index fb465d76bb..b75552df4f 100644 +--- a/test/test-path/path-modified.service ++++ b/test/test-path/path-modified.service +@@ -3,5 +3,5 @@ Description=Service Test for Path units + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true +diff --git a/test/test-path/path-mycustomunit.service b/test/test-path/path-mycustomunit.service +index bcdafe4f30..8fbc40d13f 100644 +--- a/test/test-path/path-mycustomunit.service ++++ b/test/test-path/path-mycustomunit.service +@@ -3,5 +3,5 @@ Description=Service Test Path Unit + + [Service] + ExecStart=/bin/true +-Type=simple ++Type=exec + RemainAfterExit=true diff --git a/systemd.spec b/systemd.spec index fedd1a5..5f27f07 100644 --- a/systemd.spec +++ b/systemd.spec @@ -71,11 +71,12 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[ Patch0001: use-bfq-scheduler.patch Patch0002: 0001-Revert-test-path-increase-timeout.patch -Patch0003: 0002-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch -Patch0004: 0001-test-path-more-debugging-information.patch +Patch0003: 0002-test-path-more-debugging-information.patch +Patch0004: 0003-test-path-do-not-fail-the-test-if-we-fail-to-start-s.patch +Patch0005: 0004-test-path-use-Type-exec.patch -Patch0005: 0001-test-acl-util-output-more-debug-info.patch -Patch0006: 0001-Do-not-assert-in-test_add_acls_for_user.patch +Patch0006: 0001-test-acl-util-output-more-debug-info.patch +Patch0007: 0001-Do-not-assert-in-test_add_acls_for_user.patch %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 From f74b957328251082984a90c1dfccc63d95893e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 20 Sep 2020 13:07:42 +0200 Subject: [PATCH 06/16] Version 246.6 --- sources | 2 +- systemd.spec | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sources b/sources index cd75eb4..e2e7b3b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (systemd-246.5.tar.gz) = 4006b81b03a806135178f044162db598a16d6dc1c6048229a36eadbed87f5ca3a92e3fab773d0b55a6dbbd7b1a68a978ae3a2c96bad42eb034bdd4d469659e52 +SHA512 (systemd-246.6.tar.gz) = 1936b291d9831cf61f800fe718a4c2c2fe9b2a11fd817fe32bd48da2087a675dfc91013209a3478ea52e8ada593300ed906e248b8081dcf9141bf1cc17483ea9 diff --git a/systemd.spec b/systemd.spec index 5f27f07..64227c0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -19,7 +19,7 @@ Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd -Version: 246.5 +Version: 246.6 Release: 1%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ @@ -806,6 +806,11 @@ fi %files tests -f .file-list-tests %changelog +* Sun Sep 20 2020 Zbigniew Jędrzejewski-Szmek - 246.6-1 +- Update to latest stable release (various minor fixes: manager, + networking, bootct, kernel-install, systemd-dissect, systemd-homed, + fstab-generator, documentation) (#1876905) + * Sun Sep 13 2020 Zbigniew Jędrzejewski-Szmek - 246.5-1 - Update to latest stable release (a bunch of small network-related fixes in systemd-networkd and socket handling, documentation updates, From 043ff2e2f0fc0f7033460ea562fe8a3f7988f2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 20 Sep 2020 13:11:35 +0200 Subject: [PATCH 07/16] Add patch for kernel bug --- ...96d3e8d1cb0dd3666bc74fa673918b586612.patch | 129 ++++++++++++++++++ systemd.spec | 3 + 2 files changed, 132 insertions(+) create mode 100644 f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch diff --git a/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch b/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch new file mode 100644 index 0000000..84497ad --- /dev/null +++ b/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch @@ -0,0 +1,129 @@ +From f58b96d3e8d1cb0dd3666bc74fa673918b586612 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 14 Sep 2020 17:58:03 +0200 +Subject: [PATCH] test-mountpointutil-util: do not assert in test_mnt_id() + +https://bugzilla.redhat.com/show_bug.cgi?id=1803070 + +I *think* this a kernel bug: the mnt_id as listed in /proc/self/mountinfo is different +than the one we get from /proc/self/fdinfo/. This only matters when both statx and +name_to_handle_at are unavailable and we hit the fallback path that goes through fdinfo: + +(gdb) !uname -r +5.6.19-200.fc31.ppc64le + +(gdb) !cat /proc/self/mountinfo +697 664 253:0 /var/lib/mock/fedora-31-ppc64le/root / rw,relatime shared:298 master:1 - xfs /dev/mapper/fedora_rh--power--vm14-root rw,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota +698 697 253:0 /var/cache/mock/fedora-31-ppc64le/yum_cache /var/cache/yum rw,relatime shared:299 master:1 - xfs /dev/mapper/fedora_rh--power--vm14-root rw,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota +699 697 253:0 /var/cache/mock/fedora-31-ppc64le/dnf_cache /var/cache/dnf rw,relatime shared:300 master:1 - xfs /dev/mapper/fedora_rh--power--vm14-root rw,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota +700 697 0:32 /mock-selinux-plugin.7me9bfpi /proc/filesystems rw,nosuid,nodev shared:301 master:18 - tmpfs tmpfs rw,seclabel <========================================================== +701 697 0:41 / /sys ro,nosuid,nodev,noexec,relatime shared:302 - sysfs sysfs ro,seclabel +702 701 0:21 / /sys/fs/selinux ro,nosuid,nodev,noexec,relatime shared:306 master:8 - selinuxfs selinuxfs rw +703 697 0:42 / /dev rw,nosuid shared:303 - tmpfs tmpfs rw,seclabel,mode=755 +704 703 0:43 / /dev/shm rw,nosuid,nodev shared:304 - tmpfs tmpfs rw,seclabel +705 703 0:45 / /dev/pts rw,nosuid,noexec,relatime shared:307 - devpts devpts rw,seclabel,gid=5,mode=620,ptmxmode=666 +706 703 0:6 /btrfs-control /dev/btrfs-control rw,nosuid shared:308 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +707 703 0:6 /loop-control /dev/loop-control rw,nosuid shared:309 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +708 703 0:6 /loop0 /dev/loop0 rw,nosuid shared:310 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +709 703 0:6 /loop1 /dev/loop1 rw,nosuid shared:311 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +710 703 0:6 /loop10 /dev/loop10 rw,nosuid shared:312 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +711 703 0:6 /loop11 /dev/loop11 rw,nosuid shared:313 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +712 703 0:6 /loop2 /dev/loop2 rw,nosuid shared:314 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +713 703 0:6 /loop3 /dev/loop3 rw,nosuid shared:315 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +714 703 0:6 /loop4 /dev/loop4 rw,nosuid shared:316 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +715 703 0:6 /loop5 /dev/loop5 rw,nosuid shared:317 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +716 703 0:6 /loop6 /dev/loop6 rw,nosuid shared:318 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +717 703 0:6 /loop7 /dev/loop7 rw,nosuid shared:319 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +718 703 0:6 /loop8 /dev/loop8 rw,nosuid shared:320 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +719 703 0:6 /loop9 /dev/loop9 rw,nosuid shared:321 master:9 - devtmpfs devtmpfs rw,seclabel,size=4107840k,nr_inodes=64185,mode=755 +720 697 0:44 / /run rw,nosuid,nodev shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +721 720 0:25 /systemd/nspawn/propagate/9cc8a155d0244558b273f773d2b92142 /run/systemd/nspawn/incoming ro master:12 - tmpfs tmpfs rw,seclabel,mode=755 +722 697 0:32 /mock-resolv.dvml91hp /etc/resolv.conf rw,nosuid,nodev shared:322 master:18 - tmpfs tmpfs rw,seclabel +725 697 0:47 / /proc rw,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +603 725 0:47 /sys /proc/sys ro,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +604 725 0:44 /systemd/inaccessible/reg /proc/kallsyms ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +605 725 0:44 /systemd/inaccessible/reg /proc/kcore ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +606 725 0:44 /systemd/inaccessible/reg /proc/keys ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +607 725 0:44 /systemd/inaccessible/reg /proc/sysrq-trigger ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +608 725 0:44 /systemd/inaccessible/reg /proc/timer_list ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +609 725 0:47 /bus /proc/bus ro,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +610 725 0:47 /fs /proc/fs ro,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +611 725 0:47 /irq /proc/irq ro,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +612 725 0:47 /scsi /proc/scsi ro,nosuid,nodev,noexec,relatime shared:323 - proc proc rw +613 703 0:46 / /dev/mqueue rw,nosuid,nodev,noexec,relatime shared:324 - mqueue mqueue rw,seclabel +614 701 0:26 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:325 - cgroup2 cgroup rw,seclabel,nsdelegate +615 603 0:44 /.#proc-sys-kernel-random-boot-id4fbdce67af46d1c2//deleted /proc/sys/kernel/random/boot_id ro,nosuid,nodev,noexec shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +616 725 0:44 /.#proc-sys-kernel-random-boot-id4fbdce67af46d1c2//deleted /proc/sys/kernel/random/boot_id rw,nosuid,nodev shared:305 - tmpfs tmpfs rw,seclabel,mode=755 +617 725 0:44 /.#proc-kmsg5b7a8bcfe6717139//deleted /proc/kmsg rw,nosuid,nodev shared:305 - tmpfs tmpfs rw,seclabel,mode=755 + +The test process does +name_to_handle_at("/proc/filesystems") which returns -EOPNOTSUPP, and then +openat(AT_FDCWD, "/proc/filesystems") which returns 4, and then +read(open("/proc/self/fdinfo/4", ...)) which gives +"pos:\t0\nflags:\t012100000\nmnt_id:\t725\n" + +and the "725" is clearly inconsistent with "700" in /proc/self/mountinfo. + +We could either drop the fallback path (and fail name_to_handle_at() is not +avaliable) or ignore the error in the test. Not sure what is better. I think +this issue only occurs sometimes and with older kernels, so probably continuing +with the current flaky implementation is better than ripping out the fallback. + +Another strace: +writev(2, [{iov_base="mnt ids of /proc/sys is 603", iov_len=27}, {iov_base="\n", iov_len=1}], 2mnt ids of /proc/sys is 603 +) = 28 +name_to_handle_at(AT_FDCWD, "/", {handle_bytes=128 => 12, handle_type=129, f_handle=0x52748401000000008b93e20d}, [697], 0) = 0 +writev(2, [{iov_base="mnt ids of / is 697", iov_len=19}, {iov_base="\n", iov_len=1}], 2mnt ids of / is 697 +) = 20 +name_to_handle_at(AT_FDCWD, "/proc/kcore", {handle_bytes=128 => 12, handle_type=1, f_handle=0x92ddcfcd2e802d0100000000}, [605], 0) = 0 +writev(2, [{iov_base="mnt ids of /proc/kcore is 605", iov_len=29}, {iov_base="\n", iov_len=1}], 2mnt ids of /proc/kcore is 605 +) = 30 +name_to_handle_at(AT_FDCWD, "/dev", {handle_bytes=128 => 12, handle_type=1, f_handle=0x8ae269160c802d0100000000}, [703], 0) = 0 +writev(2, [{iov_base="mnt ids of /dev is 703", iov_len=22}, {iov_base="\n", iov_len=1}], 2mnt ids of /dev is 703 +) = 23 +name_to_handle_at(AT_FDCWD, "/proc/filesystems", {handle_bytes=128}, 0x7fffe36ddb84, 0) = -1 EOPNOTSUPP (Operation not supported) +openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 4 +openat(AT_FDCWD, "/proc/self/fdinfo/4", O_RDONLY|O_CLOEXEC) = 5 +fstat(5, {st_mode=S_IFREG|0400, st_size=0, ...}) = 0 +fstat(5, {st_mode=S_IFREG|0400, st_size=0, ...}) = 0 +read(5, "pos:\t0\nflags:\t012100000\nmnt_id:\t725\n", 2048) = 36 +read(5, "", 1024) = 0 +close(5) = 0 +close(4) = 0 +writev(2, [{iov_base="mnt ids of /proc/filesystems are 700, 725", iov_len=41}, {iov_base="\n", iov_len=1}], 2mnt ids of /proc/filesystems are 700, 725 +) = 42 +writev(2, [{iov_base="the other path for mnt id 725 is /proc", iov_len=38}, {iov_base="\n", iov_len=1}], 2the other path for mnt id 725 is /proc +) = 39 +writev(2, [{iov_base="Assertion 'path_equal(p, t)' failed at src/test/test-mountpoint-util.c:94, function test_mnt_id(). Aborting.", iov_len=108}, {iov_base="\n", iov_len=1}], 2Assertion 'path_equal(p, t)' failed at src/test/test-mountpoint-util.c:94, function test_mnt_id(). Aborting. +) = 109 +rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 +rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0 +getpid() = 20 +gettid() = 20 +tgkill(20, 20, SIGABRT) = 0 +rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 +--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=20, si_uid=0} --- ++++ killed by SIGABRT (core dumped) +++ +--- + src/test/test-mountpoint-util.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c +index 30b00ae4d8b..ffe5144b04a 100644 +--- a/src/test/test-mountpoint-util.c ++++ b/src/test/test-mountpoint-util.c +@@ -89,8 +89,12 @@ static void test_mnt_id(void) { + /* The ids don't match? If so, then there are two mounts on the same path, let's check if + * that's really the case */ + char *t = hashmap_get(h, INT_TO_PTR(mnt_id2)); +- log_debug("the other path for mnt id %i is %s\n", mnt_id2, t); +- assert_se(path_equal(p, t)); ++ log_debug("Path for mnt id %i from /proc/self/mountinfo is %s\n", mnt_id2, t); ++ ++ if (!path_equal(p, t)) ++ /* Apparent kernel bug in /proc/self/fdinfo */ ++ log_warning("Bad mount id given for %s: %d, should be %d", ++ p, mnt_id2, mnt_id); + } + } + diff --git a/systemd.spec b/systemd.spec index 64227c0..0469a50 100644 --- a/systemd.spec +++ b/systemd.spec @@ -78,6 +78,8 @@ Patch0005: 0004-test-path-use-Type-exec.patch Patch0006: 0001-test-acl-util-output-more-debug-info.patch Patch0007: 0001-Do-not-assert-in-test_add_acls_for_user.patch +Patch0009: https://github.com/systemd/systemd/pull/17050/commits/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch + %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 %endif @@ -810,6 +812,7 @@ fi - Update to latest stable release (various minor fixes: manager, networking, bootct, kernel-install, systemd-dissect, systemd-homed, fstab-generator, documentation) (#1876905) +- Do not fail in test because of kernel bug (#1803070) * Sun Sep 13 2020 Zbigniew Jędrzejewski-Szmek - 246.5-1 - Update to latest stable release (a bunch of small network-related From f455b2249ac56d83b05ae75ebfc8bc792e529399 Mon Sep 17 00:00:00 2001 From: Christian Glombek Date: Thu, 24 Sep 2020 17:21:29 +0200 Subject: [PATCH 08/16] Split out networkd sub-package And add it to main package as recommended dependency. --- split-files.py | 3 +++ systemd.spec | 33 +++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/split-files.py b/split-files.py index f3e3aa6..3b62a7f 100644 --- a/split-files.py +++ b/split-files.py @@ -23,6 +23,7 @@ o_devel = open('.file-list-devel', 'w') o_container = open('.file-list-container', 'w') o_remote = open('.file-list-remote', 'w') o_tests = open('.file-list-tests', 'w') +o_networkd = open('.file-list-networkd', 'w') o_rest = open('.file-list-rest', 'w') for file in files(buildroot): n = file.path[1:] @@ -51,6 +52,8 @@ for file in files(buildroot): o = o_pam elif '/rpm/' in n: o = o_rpm_macros + elif re.search(r'networkd(?!.*\.conf)', n, re.X): + o = o_networkd elif re.search(r'/lib.*\.pc|/man3/|/usr/include|(?= 1.9.18 Requires: %{name}-pam = %{version}-%{release} Requires: %{name}-rpm-macros = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} +Recommends: %{name}-networkd = %{version}-%{release} Recommends: diffutils Requires: util-linux Recommends: libxkbcommon%{?_isa} @@ -166,7 +167,7 @@ Provides: system-setup-keyboard = 0.9 # systemd-sysv-convert was removed in f20: https://fedorahosted.org/fpc/ticket/308 Obsoletes: systemd-sysv < 206 # self-obsoletes so that dnf will install new subpackages on upgrade (#1260394) -Obsoletes: %{name} < 229-5 +Obsoletes: %{name} < 246.6-2 Provides: systemd-sysv = 206 Conflicts: initscripts < 9.56.1 %if 0%{?fedora} @@ -311,6 +312,19 @@ and to write journal files from serialized journal contents. This package contains systemd-journal-gatewayd, systemd-journal-remote, and systemd-journal-upload. +%package networkd +Summary: A system service that manages network configurations +Requires: %{name}%{?_isa} = %{version}-%{release} +License: LGPLv2+ +# https://src.fedoraproject.org/rpms/systemd/pull-request/34 +Obsoletes: systemd < 246.6-2 + +%description networkd +%{summary}. + +It detects and configures network devices as they appear, +as well as creating virtual network devices. + %package tests Summary: Internal unit tests for systemd Requires: %{name}%{?_isa} = %{version}-%{release} @@ -631,8 +645,6 @@ if [ $1 -eq 0 ] ; then serial-getty@.service \ console-getty.service \ debug-shell.service \ - systemd-networkd.service \ - systemd-networkd-wait-online.service \ systemd-resolved.service \ systemd-homed.service \ >/dev/null || : @@ -767,6 +779,14 @@ fi %systemd_postun_with_restart systemd-journal-upload.service %firewalld_reload +%preun networkd +if [ $1 -eq 0 ] ; then + systemctl disable --quiet \ + systemd-networkd.service \ + systemd-networkd-wait-online.service \ + >/dev/null || : +fi + %global _docdir_fmt %{name} %files -f %{name}.lang -f .file-list-rest @@ -805,9 +825,14 @@ fi %files journal-remote -f .file-list-remote +%files networkd -f .file-list-networkd + %files tests -f .file-list-tests %changelog +* Thu Sep 24 2020 Christian Glombek - 246.6-2 +- Split out networkd sub-package and add to main package as recommended dependency + * Sun Sep 20 2020 Zbigniew Jędrzejewski-Szmek - 246.6-1 - Update to latest stable release (various minor fixes: manager, networking, bootct, kernel-install, systemd-dissect, systemd-homed, From b50e9d7f29ce8b69ad15e5773bac1170aa6b4a0a Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 3 Jun 2020 14:40:09 -0700 Subject: [PATCH 09/16] Create separate standalone packages for tmpfiles and sysusers These packages include binaries that link to a static version of libsystemd-shared, so they don't depend on the systemd-libs package at runtime. These packages are intended to expose systemd-tmpfiles and systemd-sysusers to non-systemd systems, such as container images. Note that static linking only pulls in the small subset of functions from libsystemd-shared that are actually used by the binaries, so the total size of a statically linked binary is much smaller than the sum of the shared binary with the shared library. The resulting binaries on an x86_64 build have 272KB (tmpfiles) and 180KB (sysusers). This commit relies on the -Dstandalone-binaries=true build configuration that was pushed upstream in PR 16061 and released in systemd v246. --- split-files.py | 11 ++++++++++- systemd.spec | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/split-files.py b/split-files.py index 3b62a7f..f07b9da 100644 --- a/split-files.py +++ b/split-files.py @@ -21,9 +21,11 @@ o_pam = open('.file-list-pam', 'w') o_rpm_macros = open('.file-list-rpm-macros', 'w') o_devel = open('.file-list-devel', 'w') o_container = open('.file-list-container', 'w') +o_networkd = open('.file-list-networkd', 'w') o_remote = open('.file-list-remote', 'w') o_tests = open('.file-list-tests', 'w') -o_networkd = open('.file-list-networkd', 'w') +o_standalone_tmpfiles = open('.file-list-standalone-tmpfiles', 'w') +o_standalone_sysusers = open('.file-list-standalone-sysusers', 'w') o_rest = open('.file-list-rest', 'w') for file in files(buildroot): n = file.path[1:] @@ -112,6 +114,13 @@ for file in files(buildroot): /modprobe.d ''', n, re.X): o = o_udev + elif n.endswith('.standalone'): + if 'tmpfiles' in n: + o = o_standalone_tmpfiles + elif 'sysusers' in n: + o = o_standalone_sysusers + else: + assert False, 'Found .standalone not belonging to known packages' else: o = o_rest diff --git a/systemd.spec b/systemd.spec index cea243a..1ac69f5 100644 --- a/systemd.spec +++ b/systemd.spec @@ -334,6 +334,24 @@ License: LGPLv2+ "Installed tests" that are usually run as part of the build system. They can be useful to test systemd internals. +%package standalone-tmpfiles +Summary: Standalone tmpfiles binary for use in non-systemd systems +RemovePathPostfixes: .standalone + +%description standalone-tmpfiles +Standalone tmpfiles binary with no dependencies on the systemd-shared library +or other libraries from systemd-libs. This package conflicts with the main +systemd package and is meant for use in non-systemd systems. + +%package standalone-sysusers +Summary: Standalone sysusers binary for use in non-systemd systems +RemovePathPostfixes: .standalone + +%description standalone-sysusers +Standalone sysusers binary with no dependencies on the systemd-shared library +or other libraries from systemd-libs. This package conflicts with the main +systemd package and is meant for use in non-systemd systems. + %prep %autosetup -n %{?commit:%{name}%{?stable:-stable}-%{commit}}%{!?commit:%{name}%{?stable:-stable}-%{github_version}} -p1 @@ -388,6 +406,7 @@ CONFIGURE_OPTS=( -Dtpm=true -Dhwdb=true -Dsysusers=true + -Dstandalone-binaries=true -Ddefault-kill-user-processes=false -Dtests=unsafe -Dinstall-tests=true @@ -829,7 +848,15 @@ fi %files tests -f .file-list-tests +%files standalone-tmpfiles -f .file-list-standalone-tmpfiles + +%files standalone-sysusers -f .file-list-standalone-sysusers + %changelog +* Thu Sep 24 2020 Filipe Brandenburger - 246.6-2 +- Build a package with standalone binaries for non-systemd systems. + For now, only systemd-sysusers is included. + * Thu Sep 24 2020 Christian Glombek - 246.6-2 - Split out networkd sub-package and add to main package as recommended dependency From b36512ad8f06270739f85371d03f61bbf8e6fe2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 26 Sep 2020 21:08:03 +0200 Subject: [PATCH 10/16] Make main package Conflicts+Obsoletes with -standalone- subpackages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm not entirely sure if this is the right form... Is Conflicts? useful when we have Obsoletes? Seem to work OK. I tested: dnf --installroot=... install x86_64/systemd-standalone-sysusers-246.6-2.fc34.x86_64.rpm x86_64/systemd-standalone-tmpfiles-246.6-2.fc34.x86_64.rpm → succeeds with a new installation → fails if the installroot already had systemd installed dnf --installroot=... install x86_64/systemd{,-libs,-pam}-246.6-2.fc34.x86_64.rpm noarch/systemd-noarch-246.6-2.fc34.noarch.rpm → uninstalls the two standalone packages --- systemd.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/systemd.spec b/systemd.spec index 1ac69f5..aeccbc9 100644 --- a/systemd.spec +++ b/systemd.spec @@ -175,6 +175,10 @@ Conflicts: fedora-release < 23-0.12 %endif Obsoletes: timedatex < 0.6-3 Provides: timedatex = 0.6-3 +Conflicts: %{name}-standalone-tmpfiles < %{version}-%{release}^ +Obsoletes: %{name}-standalone-tmpfiles < %{version}-%{release}^ +Conflicts: %{name}-standalone-sysusers < %{version}-%{release}^ +Obsoletes: %{name}-standalone-sysusers < %{version}-%{release}^ %description systemd is a system and service manager that runs as PID 1 and starts From f10da8ae842479034ecf6af77cbc179baaccbb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 27 Sep 2020 13:38:40 +0200 Subject: [PATCH 11/16] Add option to disable lto This makes the build noticably faster. --- systemd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/systemd.spec b/systemd.spec index aeccbc9..919650e 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,6 +16,7 @@ # cryptsetup, e.g. when re-building cryptsetup on a json-c SONAME-bump. %bcond_with bootstrap %bcond_without tests +%bcond_without lto Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd @@ -420,7 +421,11 @@ CONFIGURE_OPTS=( -Dnobody-group=nobody -Dsplit-usr=false -Dsplit-bin=true +%if %{with lto} -Db_lto=true +%else + -Db_lto=false +%endif -Db_ndebug=false -Dman=true -Dversion-tag=v%{version}-%{release} From 147b753f29a7d483b6cbf1be12737bb2b51fe349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 27 Sep 2020 13:51:04 +0200 Subject: [PATCH 12/16] Fix permissions on libsystemd-shared.abignore --- systemd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd.spec b/systemd.spec index 919650e..ac9bde2 100644 --- a/systemd.spec +++ b/systemd.spec @@ -528,7 +528,7 @@ EOF install -Dm0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE11} -install -Dm0755 -t %{buildroot}%{_prefix}/lib/systemd/ %{SOURCE13} +install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/ %{SOURCE13} install -D -t %{buildroot}/usr/lib/systemd/ %{SOURCE3} From ce6da66f6125cbc7d4f0c533bb5a2d903fde3d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 27 Sep 2020 14:01:19 +0200 Subject: [PATCH 13/16] Pull in libfido2-devel fido2 support in homed was actually unavailable. --- systemd.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systemd.spec b/systemd.spec index ac9bde2..cb80d2d 100644 --- a/systemd.spec +++ b/systemd.spec @@ -122,6 +122,7 @@ BuildRequires: qrencode-devel BuildRequires: libmicrohttpd-devel BuildRequires: libxkbcommon-devel BuildRequires: iptables-devel +BuildRequires: pkgconfig(libfido2) BuildRequires: libxslt BuildRequires: docbook-style-xsl BuildRequires: pkgconfig @@ -406,6 +407,7 @@ CONFIGURE_OPTS=( -Dlibidn2=true -Dlibiptc=true -Dlibcurl=true + -Dlibfido2=true -Defi=true -Dgnu-efi=%{?have_gnu_efi:true}%{?!have_gnu_efi:false} -Dtpm=true From 39055121170430fa599f454533543cec89a79a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 29 Sep 2020 18:30:47 +0200 Subject: [PATCH 14/16] Upgrades: only replace NM /etc/resolv.conf if NM is enabled --- systemd.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/systemd.spec b/systemd.spec index cb80d2d..a885798 100644 --- a/systemd.spec +++ b/systemd.spec @@ -684,7 +684,9 @@ fi # This is for upgrades from previous versions before systemd-resolved became the default. systemctl --no-reload preset systemd-resolved.service &>/dev/null || : -if systemctl is-enabled systemd-resolved.service &>/dev/null; then +if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then + systemctl -q is-enabled NetworkManager.service 2>/dev/null && \ + ! test -L /etc/resolv.conf 2>/dev/null && \ grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \ echo -e '/etc/resolv.conf was generated by NetworkManager.\nRemoving it to let systemd-resolved manage this file.' && \ mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \ From 7d7120d56610db980b82dbf2703bc9c677224346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 30 Sep 2020 23:12:12 +0200 Subject: [PATCH 15/16] Only create resolv.conf symlink if sd-resolved.service is enabled This way, if one wants to opt-out of resolved, installing a preset that disables the service is enough. Previously that would only disable the service, but a dangling symlink would be created. --- systemd.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/systemd.spec b/systemd.spec index a885798..96f6a82 100644 --- a/systemd.spec +++ b/systemd.spec @@ -650,13 +650,6 @@ setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ &>/de [ $1 -eq 1 ] || exit 0 -# Create /etc/resolv.conf symlink. -# We would also create it using tmpfiles, but let's do this here unconditionally -# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above -# does not do this, because it's marked with ! and we don't specify --boot.) -# https://bugzilla.redhat.com/show_bug.cgi?id=1873856 -ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf - # We reset the enablement of all services upon initial installation # https://bugzilla.redhat.com/show_bug.cgi?id=1118740#c23 # This will fix up enablement of any preset services that got installed @@ -667,6 +660,15 @@ ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf systemctl preset-all &>/dev/null || : systemctl --global preset-all &>/dev/null || : +# Create /etc/resolv.conf symlink. +# We would also create it using tmpfiles, but let's do this here +# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above +# does not do this, because it's marked with ! and we don't specify --boot.) +# https://bugzilla.redhat.com/show_bug.cgi?id=1873856 +if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then + ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf +fi + %preun if [ $1 -eq 0 ] ; then systemctl disable --quiet \ From 283a994776e089f12953fb061ddcb64d66c1db0f Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Wed, 30 Sep 2020 12:21:11 -0400 Subject: [PATCH 16/16] split-files: break out more files into networkd subpackage There were some things left in the main package that should have been in the sub package (including networkd.conf). This is an attempt to make the list of files in the networkd package more correct. It explicitly tries to leave sytemd-network-generator and the network targets in the main package. --- split-files.py | 15 ++++++++++----- systemd.spec | 6 +++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/split-files.py b/split-files.py index f07b9da..e1b2124 100644 --- a/split-files.py +++ b/split-files.py @@ -54,12 +54,10 @@ for file in files(buildroot): o = o_pam elif '/rpm/' in n: o = o_rpm_macros - elif re.search(r'networkd(?!.*\.conf)', n, re.X): - o = o_networkd - elif re.search(r'/lib.*\.pc|/man3/|/usr/include|(? - 246.6-3 +- Try to make files in subpackages (especially the networkd subpackage) + more appropriate. + * Thu Sep 24 2020 Filipe Brandenburger - 246.6-2 - Build a package with standalone binaries for non-systemd systems. For now, only systemd-sysusers is included.