From be3800e9bac87ec8aa730cc5025d37e875acac72 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 21 2020 10:23:47 +0000 Subject: import systemd-239-31.el8_2.2 --- diff --git a/SOURCES/0331-pid1-fix-DefaultTasksMax-initialization.patch b/SOURCES/0331-pid1-fix-DefaultTasksMax-initialization.patch index 9c89a62..0a146a3 100644 --- a/SOURCES/0331-pid1-fix-DefaultTasksMax-initialization.patch +++ b/SOURCES/0331-pid1-fix-DefaultTasksMax-initialization.patch @@ -1,7 +1,7 @@ From e809564cfa5af01a26075682d49f81a987c41dd8 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 2 Oct 2019 11:58:16 +0200 -Subject: [PATCH 331/341] pid1: fix DefaultTasksMax initialization +Subject: [PATCH] pid1: fix DefaultTasksMax initialization Otherwise DefaultTasksMax is always set to "inifinity". @@ -36,6 +36,3 @@ index d6550ea161..45d09b1e11 100644 /* Assign configuration defaults */ reset_arguments(); --- -2.21.1 - diff --git a/SOURCES/0332-cgroup-make-sure-that-cpuset-is-supported-on-cgroup-.patch b/SOURCES/0332-cgroup-make-sure-that-cpuset-is-supported-on-cgroup-.patch index 2596a8e..d2c0d2e 100644 --- a/SOURCES/0332-cgroup-make-sure-that-cpuset-is-supported-on-cgroup-.patch +++ b/SOURCES/0332-cgroup-make-sure-that-cpuset-is-supported-on-cgroup-.patch @@ -1,8 +1,8 @@ From 5fc2d94fbf8271bb340e834f832af5d890c267bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= Date: Tue, 3 Mar 2020 11:45:00 +0100 -Subject: [PATCH 332/341] cgroup: make sure that cpuset is supported on cgroup - v2 and disabled with v1 +Subject: [PATCH] cgroup: make sure that cpuset is supported on cgroup v2 and + disabled with v1 Resolves: #1808940 @@ -38,6 +38,3 @@ index 6f47c3aacb..92bc1f2543 100644 n = cgroup_controller_to_string(c); if (controller_is_accessible(n) >= 0) mask |= CGROUP_CONTROLLER_TO_MASK(c); --- -2.21.1 - diff --git a/SOURCES/0333-test-introduce-TEST-36-NUMAPOLICY.patch b/SOURCES/0333-test-introduce-TEST-36-NUMAPOLICY.patch index 2e1b42a..811b91e 100644 --- a/SOURCES/0333-test-introduce-TEST-36-NUMAPOLICY.patch +++ b/SOURCES/0333-test-introduce-TEST-36-NUMAPOLICY.patch @@ -1,7 +1,7 @@ From 90dda340e4adeb1126639a849d4f31ae327fdc4b Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 25 Jun 2019 23:01:40 +0200 -Subject: [PATCH 333/341] test: introduce TEST-36-NUMAPOLICY +Subject: [PATCH] test: introduce TEST-36-NUMAPOLICY (cherry picked from commit 8f65e26508969610ac934d1aadbade8223bfcaac) @@ -378,6 +378,3 @@ index 0000000000..e15087b137 +echo OK > /testok + +exit 0 --- -2.21.1 - diff --git a/SOURCES/0334-test-replace-tail-f-with-journal-cursor-which-should.patch b/SOURCES/0334-test-replace-tail-f-with-journal-cursor-which-should.patch index 8254d16..afe81ee 100644 --- a/SOURCES/0334-test-replace-tail-f-with-journal-cursor-which-should.patch +++ b/SOURCES/0334-test-replace-tail-f-with-journal-cursor-which-should.patch @@ -1,8 +1,8 @@ From b93a2617d49d9636801130d974995cabe6335b71 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 1 Jul 2019 09:27:59 +0200 -Subject: [PATCH 334/341] test: replace `tail -f` with journal cursor which - should be... +Subject: [PATCH] test: replace `tail -f` with journal cursor which should + be... more reliable @@ -50,6 +50,3 @@ index e15087b137..306a96b517 100755 } checkNUMA() { --- -2.21.1 - diff --git a/SOURCES/0335-test-support-MPOL_LOCAL-matching-in-unpatched-strace.patch b/SOURCES/0335-test-support-MPOL_LOCAL-matching-in-unpatched-strace.patch index 8d293d9..88a2e32 100644 --- a/SOURCES/0335-test-support-MPOL_LOCAL-matching-in-unpatched-strace.patch +++ b/SOURCES/0335-test-support-MPOL_LOCAL-matching-in-unpatched-strace.patch @@ -1,7 +1,7 @@ From d6d43b81df76d571d57f83ceb050c8b4ac4701b8 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 1 Jul 2019 13:08:26 +0200 -Subject: [PATCH 335/341] test: support MPOL_LOCAL matching in unpatched strace +Subject: [PATCH] test: support MPOL_LOCAL matching in unpatched strace versions The MPOL_LOCAL constant is not recognized in current strace versions. @@ -56,6 +56,3 @@ index 306a96b517..a4134bdeca 100755 echo "systemd-run NUMAPolicy support" runUnit='numa-systemd-run-test.service' --- -2.21.1 - diff --git a/SOURCES/0336-test-make-sure-the-strace-process-is-indeed-dead.patch b/SOURCES/0336-test-make-sure-the-strace-process-is-indeed-dead.patch index 55d9b4f..24d38b3 100644 --- a/SOURCES/0336-test-make-sure-the-strace-process-is-indeed-dead.patch +++ b/SOURCES/0336-test-make-sure-the-strace-process-is-indeed-dead.patch @@ -1,7 +1,7 @@ From 60813b55f9b5b44b14f38bbc1b8c0d2b30e3f6c7 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 1 Jul 2019 19:53:45 +0200 -Subject: [PATCH 336/341] test: make sure the strace process is indeed dead +Subject: [PATCH] test: make sure the strace process is indeed dead It may take a few moments for the strace process to properly terminate and write all logs to the backing storage @@ -48,6 +48,3 @@ index a4134bdeca..daed8fcc1c 100755 stopStrace } --- -2.21.1 - diff --git a/SOURCES/0337-test-skip-the-test-on-systems-without-NUMA-support.patch b/SOURCES/0337-test-skip-the-test-on-systems-without-NUMA-support.patch index 2680709..eef7e87 100644 --- a/SOURCES/0337-test-skip-the-test-on-systems-without-NUMA-support.patch +++ b/SOURCES/0337-test-skip-the-test-on-systems-without-NUMA-support.patch @@ -1,7 +1,7 @@ From ad3e4a0f010c9497b01d89de54213af982f8afd2 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 2 Jul 2019 09:52:45 +0200 -Subject: [PATCH 337/341] test: skip the test on systems without NUMA support +Subject: [PATCH] test: skip the test on systems without NUMA support (cherry picked from commit b030847163e9bd63d3dd6eec6ac7f336411faba6) @@ -34,6 +34,3 @@ index daed8fcc1c..4b715d305a 100755 writeTestUnit # Create systemd config drop-in directory --- -2.21.1 - diff --git a/SOURCES/0338-test-give-strace-some-time-to-initialize.patch b/SOURCES/0338-test-give-strace-some-time-to-initialize.patch index 5d68666..6cd3426 100644 --- a/SOURCES/0338-test-give-strace-some-time-to-initialize.patch +++ b/SOURCES/0338-test-give-strace-some-time-to-initialize.patch @@ -1,7 +1,7 @@ From 66f6f6304d87b2fe0c4f91373c7d1b836de1b054 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 23 Jul 2019 00:56:04 +0200 -Subject: [PATCH 338/341] test: give strace some time to initialize +Subject: [PATCH] test: give strace some time to initialize The `coproc` implementation seems to be a little bit different in older bash versions, so the `strace` is sometimes started AFTER `systemctl @@ -28,6 +28,3 @@ index 4b715d305a..1c8cf7e6b6 100755 } stopStrace() { --- -2.21.1 - diff --git a/SOURCES/0339-test-add-a-simple-sanity-check-for-systems-without-N.patch b/SOURCES/0339-test-add-a-simple-sanity-check-for-systems-without-N.patch index 10d52aa..2bb77a3 100644 --- a/SOURCES/0339-test-add-a-simple-sanity-check-for-systems-without-N.patch +++ b/SOURCES/0339-test-add-a-simple-sanity-check-for-systems-without-N.patch @@ -1,8 +1,8 @@ From 8239ecf0b4b8bbe5b3c17964d230d13cee4d900a Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 5 Aug 2019 14:38:45 +0200 -Subject: [PATCH 339/341] test: add a simple sanity check for systems without - NUMA support +Subject: [PATCH] test: add a simple sanity check for systems without NUMA + support (cherry picked from commit 92f8e978923f962a57d744c5f358520ac06f7892) @@ -389,6 +389,3 @@ index 1c8cf7e6b6..a5ac788178 100755 # Cleanup rm -rf $testDir --- -2.21.1 - diff --git a/SOURCES/0340-test-drop-the-missed-exit-1-expression.patch b/SOURCES/0340-test-drop-the-missed-exit-1-expression.patch index d0df520..716dcf2 100644 --- a/SOURCES/0340-test-drop-the-missed-exit-1-expression.patch +++ b/SOURCES/0340-test-drop-the-missed-exit-1-expression.patch @@ -1,7 +1,7 @@ From 772f08f8255d7ab921c344ab4243249cbd1c37fc Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Sat, 10 Aug 2019 16:05:07 +0200 -Subject: [PATCH 340/341] test: drop the missed || exit 1 expression +Subject: [PATCH] test: drop the missed || exit 1 expression ...as we've already done in the rest of the testsuite, see cc469c3dfc398210f38f819d367e68646c71d8da @@ -33,6 +33,3 @@ index f0a321e7a1..3b3b120423 100755 setup_nspawn_root ddebug "umount $TESTDIR/root" --- -2.21.1 - diff --git a/SOURCES/0341-test-replace-cursor-file-with-a-plain-cursor.patch b/SOURCES/0341-test-replace-cursor-file-with-a-plain-cursor.patch index f3b1f25..83a7f55 100644 --- a/SOURCES/0341-test-replace-cursor-file-with-a-plain-cursor.patch +++ b/SOURCES/0341-test-replace-cursor-file-with-a-plain-cursor.patch @@ -1,7 +1,7 @@ From 0bef8805c81eecfe3960bf00b6022837e4979198 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 3 Mar 2020 15:54:29 +0100 -Subject: [PATCH 341/341] test: replace cursor file with a plain cursor +Subject: [PATCH] test: replace cursor file with a plain cursor systemd in RHEL 8 doesn't support the --cursor-file option, so let's fall back to a plain cursor string @@ -57,6 +57,3 @@ index a5ac788178..bffac4ffe6 100755 } checkNUMA() { --- -2.21.1 - diff --git a/SOURCES/0346-swap-finish-the-secondary-swap-units-jobs-if-deactiv.patch b/SOURCES/0346-swap-finish-the-secondary-swap-units-jobs-if-deactiv.patch new file mode 100644 index 0000000..0c8e0e7 --- /dev/null +++ b/SOURCES/0346-swap-finish-the-secondary-swap-units-jobs-if-deactiv.patch @@ -0,0 +1,80 @@ +From 0c0129bd214df25318d267fbbfe2cde6fc18b465 Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Wed, 24 Jul 2019 23:54:48 -0400 +Subject: [PATCH] swap: finish the secondary swap units' jobs if deactivation + of the primary swap unit fails + +Currently, if deactivation of the primary swap unit fails: + + # LANG=C systemctl --no-pager stop dev-mapper-fedora\\x2dswap.swap + Job for dev-mapper-fedora\x2dswap.swap failed. + See "systemctl status "dev-mapper-fedora\\x2dswap.swap"" and "journalctl -xe" for details. + +then there are still the running stop jobs for all the secondary swap units +that follow the primary one: + + # systemctl list-jobs + JOB UNIT TYPE STATE + 3233 dev-disk-by\x2duuid-2dc8b9b1\x2da0a5\x2d44d8\x2d89c4\x2d6cdd26cd5ce0.swap stop running + 3232 dev-dm\x2d1.swap stop running + 3231 dev-disk-by\x2did-dm\x2duuid\x2dLVM\x2dyuXWpCCIurGzz2nkGCVnUFSi7GH6E3ZcQjkKLnF0Fil0RJmhoLN8fcOnDybWCMTj.swap stop running + 3230 dev-disk-by\x2did-dm\x2dname\x2dfedora\x2dswap.swap stop running + 3234 dev-fedora-swap.swap stop running + + 5 jobs listed. + +This remains endlessly because their JobTimeoutUSec is infinity: + + # LANG=C systemctl show -p JobTimeoutUSec dev-fedora-swap.swap + JobTimeoutUSec=infinity + +If this issue happens during system shutdown, the system shutdown appears to +get hang and the system will be forcibly shutdown or rebooted 30 minutes later +by the following configuration: + + # grep -E "^JobTimeout" /usr/lib/systemd/system/reboot.target + JobTimeoutSec=30min + JobTimeoutAction=reboot-force + +The scenario in the real world seems that there is some service unit with +KillMode=none, processes whose memory is being swapped out are not killed +during stop operation in the service unit and then swapoff command fails. + +On the other hand, it works well in successful case of swapoff command because +the secondary jobs monitor /proc/swaps file and can detect deletion of the +corresponding swap file. + +This commit fixes the issue by finishing the secondary swap units' jobs if +deactivation of the primary swap unit fails. + +Fixes: #11577 +(cherry picked from commit 9c1f969d40f84d5cc98d810bab8b24148b2d8928) +(cherry picked from commit b89a1a9d19aa806feb984c8dba25116b5b5a52bc) + +Resolves: #1821372 +--- + src/core/swap.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/core/swap.c b/src/core/swap.c +index e717dbb54a..66a62d8a37 100644 +--- a/src/core/swap.c ++++ b/src/core/swap.c +@@ -682,9 +682,15 @@ static void swap_enter_active(Swap *s, SwapResult f) { + static void swap_enter_dead_or_active(Swap *s, SwapResult f) { + assert(s); + +- if (s->from_proc_swaps) ++ if (s->from_proc_swaps) { ++ Swap *other; ++ + swap_enter_active(s, f); +- else ++ ++ LIST_FOREACH_OTHERS(same_devnode, other, s) ++ if (UNIT(other)->job) ++ swap_enter_dead_or_active(other, f); ++ } else + swap_enter_dead(s, f); + } + diff --git a/SOURCES/0347-pid1-add-new-kernel-cmdline-arg-systemd.cpu_affinity.patch b/SOURCES/0347-pid1-add-new-kernel-cmdline-arg-systemd.cpu_affinity.patch new file mode 100644 index 0000000..b1240c9 --- /dev/null +++ b/SOURCES/0347-pid1-add-new-kernel-cmdline-arg-systemd.cpu_affinity.patch @@ -0,0 +1,62 @@ +From fab8f70326d687479ef63fe177572ab512bf965e Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 26 Nov 2019 09:46:00 +0100 +Subject: [PATCH] pid1: add new kernel cmdline arg systemd.cpu_affinity= + +Let's allow configuration of the CPU affinity via the kernel cmdline, +overriding CPUAffinity= in /etc/systemd/system.conf + +Prompted by: + +https://lists.freedesktop.org/archives/systemd-devel/2019-November/043754.html + +(cherry picked from commit 68d58f38693e586b5ce5785274f8e42a79625196) + +Resolves: #1827621 +--- + man/kernel-command-line.xml | 11 +++++++++++ + src/core/main.c | 9 +++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml +index 0545f9d84b..4d8cb4e50e 100644 +--- a/man/kernel-command-line.xml ++++ b/man/kernel-command-line.xml +@@ -366,6 +366,17 @@ + + + ++ ++ systemd.cpu_affinity= ++ ++ ++ Overrides the CPU affinity mask for the service manager and the default for all child ++ processes it forks. This takes precedence over CPUAffinity=, see ++ systemd-system.conf5 ++ for details. ++ ++ ++ + + modules_load= + rd.modules_load= +diff --git a/src/core/main.c b/src/core/main.c +index 45d09b1e11..9f238a8430 100644 +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -472,6 +472,15 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat + if (arg_default_timeout_start_usec <= 0) + arg_default_timeout_start_usec = USEC_INFINITY; + ++ } else if (proc_cmdline_key_streq(key, "systemd.cpu_affinity")) { ++ ++ if (proc_cmdline_value_missing(key, value)) ++ return 0; ++ ++ r = parse_cpu_set(value, &arg_cpu_affinity); ++ if (r < 0) ++ log_warning_errno(r, "Failed to parse CPU affinity mask '%s', ignoring: %m", value); ++ + } else if (proc_cmdline_key_streq(key, "systemd.watchdog_device")) { + + if (proc_cmdline_value_missing(key, value)) diff --git a/SOURCES/0348-sd-journal-close-journal-files-that-were-deleted-by-.patch b/SOURCES/0348-sd-journal-close-journal-files-that-were-deleted-by-.patch new file mode 100644 index 0000000..9cd8649 --- /dev/null +++ b/SOURCES/0348-sd-journal-close-journal-files-that-were-deleted-by-.patch @@ -0,0 +1,75 @@ +From c01a24e9ad46eb17de5c37296194d2ce97916439 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= +Date: Tue, 4 Feb 2020 14:23:14 +0100 +Subject: [PATCH] sd-journal: close journal files that were deleted by journald + before we've setup inotify watch + +Fixes #14695 + +(cherry picked from commit 28ca867abdb20d0e4ac1901e2ed669cdb41ea3f6) + +Related: #1826217 +--- + src/journal/journal-file.c | 2 +- + src/journal/journal-file.h | 1 + + src/journal/sd-journal.c | 15 +++++++++++++++ + 3 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c +index 8249b11b23..7ab3c47fc9 100644 +--- a/src/journal/journal-file.c ++++ b/src/journal/journal-file.c +@@ -597,7 +597,7 @@ static int journal_file_verify_header(JournalFile *f) { + return 0; + } + +-static int journal_file_fstat(JournalFile *f) { ++int journal_file_fstat(JournalFile *f) { + int r; + + assert(f); +diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h +index 6a44fd39d2..6069b35234 100644 +--- a/src/journal/journal-file.h ++++ b/src/journal/journal-file.h +@@ -144,6 +144,7 @@ int journal_file_open( + int journal_file_set_offline(JournalFile *f, bool wait); + bool journal_file_is_offlining(JournalFile *f); + JournalFile* journal_file_close(JournalFile *j); ++int journal_file_fstat(JournalFile *f); + DEFINE_TRIVIAL_CLEANUP_FUNC(JournalFile*, journal_file_close); + + int journal_file_open_reliably( +diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c +index 323300baec..c06255e273 100644 +--- a/src/journal/sd-journal.c ++++ b/src/journal/sd-journal.c +@@ -2584,6 +2584,8 @@ _public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) { + assert_return(!journal_pid_changed(j), -ECHILD); + + if (j->inotify_fd < 0) { ++ Iterator i; ++ JournalFile *f; + + /* This is the first invocation, hence create the + * inotify watch */ +@@ -2591,6 +2593,19 @@ _public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) { + if (r < 0) + return r; + ++ /* Server might have done some vacuuming while we weren't watching. ++ Get rid of the deleted files now so they don't stay around indefinitely. */ ++ ORDERED_HASHMAP_FOREACH(f, j->files, i) { ++ r = journal_file_fstat(f); ++ if (r < 0) { ++ log_debug_errno(r,"Failed to fstat() journal file '%s' : %m", f->path); ++ continue; ++ } ++ ++ if (f->last_stat.st_nlink <= 0) ++ remove_file_real(j, f); ++ } ++ + /* The journal might have changed since the context + * object was created and we weren't watching before, + * hence don't wait for anything, and return diff --git a/SOURCES/0349-sd-journal-remove-the-dead-code-and-actually-fix-146.patch b/SOURCES/0349-sd-journal-remove-the-dead-code-and-actually-fix-146.patch new file mode 100644 index 0000000..6b07582 --- /dev/null +++ b/SOURCES/0349-sd-journal-remove-the-dead-code-and-actually-fix-146.patch @@ -0,0 +1,42 @@ +From 0faa7696c9fa504b7cfea189340871d262814c40 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= +Date: Fri, 27 Mar 2020 17:01:59 +0100 +Subject: [PATCH] sd-journal: remove the dead code and actually fix #14695 + +journal_file_fstat() returns an error if we call it on already unlinked +journal file and hence we never reach remove_file_real() which is the +entire point. + +I must have made some mistake while testing the fix that got me thinking +the issue is gone while opposite was true. + +Fixes #14695 + +(cherry picked from commit 8581b9f9732d4c158bb5f773230a65ce77f2c292) + +Resolves: #1826217 +--- + src/journal/sd-journal.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c +index c06255e273..4c502978de 100644 +--- a/src/journal/sd-journal.c ++++ b/src/journal/sd-journal.c +@@ -2597,13 +2597,12 @@ _public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) { + Get rid of the deleted files now so they don't stay around indefinitely. */ + ORDERED_HASHMAP_FOREACH(f, j->files, i) { + r = journal_file_fstat(f); +- if (r < 0) { ++ if (r == -EIDRM) ++ remove_file_real(j, f); ++ else if (r < 0) { + log_debug_errno(r,"Failed to fstat() journal file '%s' : %m", f->path); + continue; + } +- +- if (f->last_stat.st_nlink <= 0) +- remove_file_real(j, f); + } + + /* The journal might have changed since the context diff --git a/SOURCES/0350-test-do-not-use-global-variable-to-pass-error.patch b/SOURCES/0350-test-do-not-use-global-variable-to-pass-error.patch new file mode 100644 index 0000000..23b3734 --- /dev/null +++ b/SOURCES/0350-test-do-not-use-global-variable-to-pass-error.patch @@ -0,0 +1,59 @@ +From 31cb1d714effd3f7fae4f079d5639e74b3349a17 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Fri, 14 Sep 2018 13:25:02 +0900 +Subject: [PATCH] test: do not use global variable to pass error + +(cherry picked from commit 0013fac248a15be3acce84c17a65e3ae0377294b) +(cherry picked from commit a521c49bd30f6b985bb43284d7162b7b68ec7d1c) + +Resolves: #1836979 +--- + test/TEST-21-SYSUSERS/test.sh | 1 + + test/test-functions | 8 +++++--- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/test/TEST-21-SYSUSERS/test.sh b/test/TEST-21-SYSUSERS/test.sh +index 73cbe10b69..b1049e720d 100755 +--- a/test/TEST-21-SYSUSERS/test.sh ++++ b/test/TEST-21-SYSUSERS/test.sh +@@ -15,6 +15,7 @@ prepare_testdir() { + for i in $1.initial-{passwd,group,shadow}; do + test -f $i && cp $i $TESTDIR/etc/${i#*.initial-} + done ++ return 0 + } + + preprocess() { +diff --git a/test/test-functions b/test/test-functions +index fe25a501da..da83891f46 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -449,7 +449,7 @@ EOF + } + + check_result_nspawn() { +- ret=1 ++ local ret=1 + [[ -e $TESTDIR/$1/testok ]] && ret=0 + [[ -f $TESTDIR/$1/failed ]] && cp -a $TESTDIR/$1/failed $TESTDIR + cp -a $TESTDIR/$1/var/log/journal $TESTDIR +@@ -462,7 +462,7 @@ check_result_nspawn() { + + # can be overridden in specific test + check_result_qemu() { +- ret=1 ++ local ret=1 + mkdir -p $TESTDIR/root + mount ${LOOPDEV}p1 $TESTDIR/root + [[ -e $TESTDIR/root/testok ]] && ret=0 +@@ -1527,7 +1527,9 @@ do_test() { + case $1 in + --run) + echo "TEST RUN: $TEST_DESCRIPTION" +- if test_run; then ++ test_run ++ ret=$? ++ if (( $ret == 0 )); then + echo "TEST RUN: $TEST_DESCRIPTION [OK]" + else + echo "TEST RUN: $TEST_DESCRIPTION [FAILED]" diff --git a/SOURCES/0351-test-install-libraries-required-by-tests.patch b/SOURCES/0351-test-install-libraries-required-by-tests.patch new file mode 100644 index 0000000..3962944 --- /dev/null +++ b/SOURCES/0351-test-install-libraries-required-by-tests.patch @@ -0,0 +1,26 @@ +From ace270db3fcf163ed2c09a67236c1b4d55a0a4e7 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 12 Sep 2018 18:19:45 +0900 +Subject: [PATCH] test: install libraries required by tests + +(cherry picked from commit e3d3dada248c5f30e2978840ca1f0a03a4675b53) +(cherry picked from commit 813d60bd9d668eb1e5c897edbea966bfae25647c) + +Resolves: #1836979 +--- + test/test-functions | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test-functions b/test/test-functions +index da83891f46..f7ca3ad975 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -420,7 +420,7 @@ get_ldpath() { + + install_missing_libraries() { + # install possible missing libraries +- for i in $initdir{,/usr}/{sbin,bin}/* $initdir{,/usr}/lib/systemd/*; do ++ for i in $initdir{,/usr}/{sbin,bin}/* $initdir{,/usr}/lib/systemd/{,tests/{,manual/,unsafe/}}*; do + LD_LIBRARY_PATH=$(get_ldpath $i) inst_libs $i + done + } diff --git a/SOURCES/0352-test-introduce-install_zoneinfo.patch b/SOURCES/0352-test-introduce-install_zoneinfo.patch new file mode 100644 index 0000000..3676038 --- /dev/null +++ b/SOURCES/0352-test-introduce-install_zoneinfo.patch @@ -0,0 +1,33 @@ +From fcea985d245dd5854aee2bad8b84b0ace0c93fec Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 12 Sep 2018 18:20:31 +0900 +Subject: [PATCH] test: introduce install_zoneinfo() + +But it is not called by default. + +(cherry picked from commit 7d10ec1cda8fed20c36b16d2387f529583645cda) +(cherry picked from commit a66d62e7c8c28d9e5382362a279d1dfa06089996) + +Resolves: #1836979 +--- + test/test-functions | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/test/test-functions b/test/test-functions +index f7ca3ad975..4d76ed1f82 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -628,6 +628,13 @@ install_keymaps() { + done + } + ++install_zoneinfo() { ++ for i in /usr/share/zoneinfo/{,*/,*/*/}*; do ++ [[ -f $i ]] || continue ++ inst $i ++ done ++} ++ + install_fonts() { + for i in \ + /usr/lib/kbd/consolefonts/eurlatgr* \ diff --git a/SOURCES/0353-test-replace-duplicated-Makefile-by-symbolic-link.patch b/SOURCES/0353-test-replace-duplicated-Makefile-by-symbolic-link.patch new file mode 100644 index 0000000..2997332 --- /dev/null +++ b/SOURCES/0353-test-replace-duplicated-Makefile-by-symbolic-link.patch @@ -0,0 +1,152 @@ +From d87f4abdf99b0bdfeec4eaf05a660dd7d7291a0b Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Thu, 13 Sep 2018 03:01:42 +0900 +Subject: [PATCH] test: replace duplicated Makefile by symbolic link + +(cherry picked from commit dd75c133d81f07c56c82ee4e7a80f391ffebd9ce) +(cherry picked from commit e02d918ddcc77b9ad87a328482b7a2c6f95d31ce) + +Resolves: #1836979 +--- + test/TEST-17-UDEV-WANTS/Makefile | 5 +---- + test/TEST-18-FAILUREACTION/Makefile | 5 +---- + test/TEST-19-DELEGATE/Makefile | 5 +---- + test/TEST-20-MAINPIDGAMES/Makefile | 5 +---- + test/TEST-21-SYSUSERS/Makefile | 5 +---- + test/TEST-22-TMPFILES/Makefile | 5 +---- + test/TEST-23-TYPE-EXEC/Makefile | 5 +---- + 7 files changed, 7 insertions(+), 28 deletions(-) + mode change 100644 => 120000 test/TEST-17-UDEV-WANTS/Makefile + mode change 100644 => 120000 test/TEST-18-FAILUREACTION/Makefile + mode change 100644 => 120000 test/TEST-19-DELEGATE/Makefile + mode change 100644 => 120000 test/TEST-20-MAINPIDGAMES/Makefile + mode change 100644 => 120000 test/TEST-21-SYSUSERS/Makefile + mode change 100644 => 120000 test/TEST-22-TMPFILES/Makefile + mode change 100644 => 120000 test/TEST-23-TYPE-EXEC/Makefile + +diff --git a/test/TEST-17-UDEV-WANTS/Makefile b/test/TEST-17-UDEV-WANTS/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-17-UDEV-WANTS/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-17-UDEV-WANTS/Makefile b/test/TEST-17-UDEV-WANTS/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-17-UDEV-WANTS/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-18-FAILUREACTION/Makefile b/test/TEST-18-FAILUREACTION/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-18-FAILUREACTION/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-18-FAILUREACTION/Makefile b/test/TEST-18-FAILUREACTION/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-18-FAILUREACTION/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-19-DELEGATE/Makefile b/test/TEST-19-DELEGATE/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-19-DELEGATE/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-19-DELEGATE/Makefile b/test/TEST-19-DELEGATE/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-19-DELEGATE/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-20-MAINPIDGAMES/Makefile b/test/TEST-20-MAINPIDGAMES/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-20-MAINPIDGAMES/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-20-MAINPIDGAMES/Makefile b/test/TEST-20-MAINPIDGAMES/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-20-MAINPIDGAMES/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-21-SYSUSERS/Makefile b/test/TEST-21-SYSUSERS/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-21-SYSUSERS/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-21-SYSUSERS/Makefile b/test/TEST-21-SYSUSERS/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-21-SYSUSERS/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-22-TMPFILES/Makefile b/test/TEST-22-TMPFILES/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-22-TMPFILES/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-22-TMPFILES/Makefile b/test/TEST-22-TMPFILES/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-22-TMPFILES/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file +diff --git a/test/TEST-23-TYPE-EXEC/Makefile b/test/TEST-23-TYPE-EXEC/Makefile +deleted file mode 100644 +index 34d7cc6cdf..0000000000 +--- a/test/TEST-23-TYPE-EXEC/Makefile ++++ /dev/null +@@ -1,4 +0,0 @@ +-BUILD_DIR=$(shell ../../tools/find-build-dir.sh) +- +-all setup clean run: +- @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ +diff --git a/test/TEST-23-TYPE-EXEC/Makefile b/test/TEST-23-TYPE-EXEC/Makefile +new file mode 120000 +index 0000000000..e9f93b1104 +--- /dev/null ++++ b/test/TEST-23-TYPE-EXEC/Makefile +@@ -0,0 +1 @@ ++../TEST-01-BASIC/Makefile +\ No newline at end of file diff --git a/SOURCES/0354-test-add-paths-of-keymaps-in-install_keymaps.patch b/SOURCES/0354-test-add-paths-of-keymaps-in-install_keymaps.patch new file mode 100644 index 0000000..acadc38 --- /dev/null +++ b/SOURCES/0354-test-add-paths-of-keymaps-in-install_keymaps.patch @@ -0,0 +1,35 @@ +From d3ceee6505786b406da833b50e3d537da607612d Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 19 Sep 2018 10:54:16 +0900 +Subject: [PATCH] test: add paths of keymaps in install_keymaps() + +It seems that the paths of directories storing keymaps are changed. + +(cherry picked from commit 83a7051ee1edbfe8cd2278477d23083beb385409) +(cherry picked from commit 808bf3d4c789019fd7cc1a0568f3836e200d9550) + +Resolves: #1836979 +--- + test/test-functions | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/test/test-functions b/test/test-functions +index 4d76ed1f82..546928c516 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -619,10 +619,14 @@ install_pam() { + } + + install_keymaps() { ++ # The first three paths may be deprecated. ++ # It seems now the last two paths are used by many distributions. + for i in \ + /usr/lib/kbd/keymaps/include/* \ + /usr/lib/kbd/keymaps/i386/include/* \ +- /usr/lib/kbd/keymaps/i386/qwerty/us.*; do ++ /usr/lib/kbd/keymaps/i386/qwerty/us.* \ ++ /usr/lib/kbd/keymaps/legacy/include/* \ ++ /usr/lib/kbd/keymaps/legacy/i386/qwerty/us.*; do + [[ -f $i ]] || continue + inst $i + done diff --git a/SOURCES/0355-test-make-install_keymaps-optionally-install-more-ke.patch b/SOURCES/0355-test-make-install_keymaps-optionally-install-more-ke.patch new file mode 100644 index 0000000..24e5150 --- /dev/null +++ b/SOURCES/0355-test-make-install_keymaps-optionally-install-more-ke.patch @@ -0,0 +1,34 @@ +From 7e0f8e0f9c6790f2c2954d2102a478953e7a74af Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 19 Sep 2018 10:54:28 +0900 +Subject: [PATCH] test: make install_keymaps() optionally install more keymaps + +(cherry picked from commit ad931fee506e1313e8a520ae0ecc1c8e275d9941) +(cherry picked from commit bc06966ff3d335102287a4d0ec525e527bc6a139) + +Resolves: #1836979 +--- + test/test-functions | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/test/test-functions b/test/test-functions +index 546928c516..0938e6e826 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -630,6 +630,16 @@ install_keymaps() { + [[ -f $i ]] || continue + inst $i + done ++ ++ # When it takes any argument, then install more keymaps. ++ if [[ -n $1 ]]; then ++ for i in \ ++ /usr/lib/kbd/keymaps/i386/*/* \ ++ /usr/lib/kbd/keymaps/legacy/i386/*/*; do ++ [[ -f $i ]] || continue ++ inst $i ++ done ++ fi + } + + install_zoneinfo() { diff --git a/SOURCES/0356-test-fs-util-skip-some-tests-when-running-in-unprivi.patch b/SOURCES/0356-test-fs-util-skip-some-tests-when-running-in-unprivi.patch new file mode 100644 index 0000000..54abfcb --- /dev/null +++ b/SOURCES/0356-test-fs-util-skip-some-tests-when-running-in-unprivi.patch @@ -0,0 +1,48 @@ +From 5db1bccba4a0b5970462e06a1274fcc6fd34bdcc Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Fri, 14 Sep 2018 15:51:04 +0900 +Subject: [PATCH] test-fs-util: skip some tests when running in unprivileged + container + +(cherry picked from commit 9590065f37be040996f1c2b9a246b9952fdc0c0b) +(cherry picked from commit bf2234c276fd14ac78e2c559c762751ea6145441) + +Resolves: #1836979 +--- + src/test/test-fs-util.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c +index 7b7990bb70..e3338ea440 100644 +--- a/src/test/test-fs-util.c ++++ b/src/test/test-fs-util.c +@@ -17,6 +17,7 @@ + #include "strv.h" + #include "user-util.h" + #include "util.h" ++#include "virt.h" + + static void test_chase_symlinks(void) { + _cleanup_free_ char *result = NULL; +@@ -468,6 +469,7 @@ static void test_touch_file(void) { + struct stat st; + const char *a; + usec_t test_mtime; ++ int r; + + test_uid = geteuid() == 0 ? 65534 : getuid(); + test_gid = geteuid() == 0 ? 65534 : getgid(); +@@ -517,7 +519,12 @@ static void test_touch_file(void) { + + if (geteuid() == 0) { + a = strjoina(p, "/cdev"); +- assert_se(mknod(a, 0775 | S_IFCHR, makedev(0, 0)) >= 0); ++ r = mknod(a, 0775 | S_IFCHR, makedev(0, 0)); ++ if (r < 0 && errno == EPERM && detect_container() > 0) { ++ log_notice("Running in unprivileged container? Skipping remaining tests in %s", __func__); ++ return; ++ } ++ assert_se(r >= 0); + assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0); + assert_se(lstat(a, &st) >= 0); + assert_se(st.st_uid == test_uid); diff --git a/SOURCES/0357-test-process-util-skip-several-verifications-when-ru.patch b/SOURCES/0357-test-process-util-skip-several-verifications-when-ru.patch new file mode 100644 index 0000000..12b9132 --- /dev/null +++ b/SOURCES/0357-test-process-util-skip-several-verifications-when-ru.patch @@ -0,0 +1,40 @@ +From 6f3d631982c7914f63f1e5e8eb171a1646105395 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Thu, 20 Sep 2018 16:08:38 +0900 +Subject: [PATCH] test-process-util: skip several verifications when running in + unprivileged container + +(cherry picked from commit 767eab47501b06327a0e6030e5c54860a3fc427f) +(cherry picked from commit 2bc26a0ac181124ba06022bcf4744ae7d5bdcc9d) + +Resolves: #1836979 +--- + src/test/test-process-util.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c +index fd4d17408d..26e3247993 100644 +--- a/src/test/test-process-util.c ++++ b/src/test/test-process-util.c +@@ -394,12 +394,17 @@ static void test_rename_process_now(const char *p, int ret) { + log_info("comm = <%s>", comm); + assert_se(strneq(comm, p, TASK_COMM_LEN-1)); + +- assert_se(get_process_cmdline(0, 0, false, &cmdline) >= 0); ++ r = get_process_cmdline(0, 0, false, &cmdline); ++ assert_se(r >= 0); + /* we cannot expect cmdline to be renamed properly without privileges */ + if (geteuid() == 0) { +- log_info("cmdline = <%s>", cmdline); +- assert_se(strneq(p, cmdline, STRLEN("test-process-util"))); +- assert_se(startswith(p, cmdline)); ++ if (r == 0 && detect_container() > 0) ++ log_info("cmdline = <%s> (not verified, Running in unprivileged container?)", cmdline); ++ else { ++ log_info("cmdline = <%s>", cmdline); ++ assert_se(strneq(p, cmdline, STRLEN("test-process-util"))); ++ assert_se(startswith(p, cmdline)); ++ } + } else + log_info("cmdline = <%s> (not verified)", cmdline); + } diff --git a/SOURCES/0358-test-execute-also-check-python3-is-installed-or-not.patch b/SOURCES/0358-test-execute-also-check-python3-is-installed-or-not.patch new file mode 100644 index 0000000..29ee223 --- /dev/null +++ b/SOURCES/0358-test-execute-also-check-python3-is-installed-or-not.patch @@ -0,0 +1,60 @@ +From 464a88eeb63c0e733633c7d8eef3a48f68b8440e Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 12 Sep 2018 18:18:33 +0900 +Subject: [PATCH] test-execute: also check python3 is installed or not + +(cherry picked from commit 738c74d7b163ea18e3c68115c3ed8ceed166cbf7) +(cherry picked from commit 6750925014bcd2d2289af08cdc5d81b673c36779) + +Resolves: #1836979 +--- + src/test/test-execute.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/src/test/test-execute.c b/src/test/test-execute.c +index 6c22995b1e..af64427bc7 100644 +--- a/src/test/test-execute.c ++++ b/src/test/test-execute.c +@@ -317,6 +317,8 @@ static void test_exec_temporaryfilesystem(Manager *m) { + + static void test_exec_systemcallfilter(Manager *m) { + #if HAVE_SECCOMP ++ int r; ++ + if (!is_seccomp_available()) { + log_notice("Seccomp not available, skipping %s", __func__); + return; +@@ -326,6 +328,13 @@ static void test_exec_systemcallfilter(Manager *m) { + test(m, "exec-systemcallfilter-not-failing2.service", 0, CLD_EXITED); + test(m, "exec-systemcallfilter-failing.service", SIGSYS, CLD_KILLED); + test(m, "exec-systemcallfilter-failing2.service", SIGSYS, CLD_KILLED); ++ ++ r = find_binary("python3", NULL); ++ if (r < 0) { ++ log_notice_errno(r, "Skipping remaining tests in %s, could not find python3 binary: %m", __func__); ++ return; ++ } ++ + test(m, "exec-systemcallfilter-with-errno-name.service", errno_from_name("EILSEQ"), CLD_EXITED); + test(m, "exec-systemcallfilter-with-errno-number.service", 255, CLD_EXITED); + #endif +@@ -333,11 +342,19 @@ static void test_exec_systemcallfilter(Manager *m) { + + static void test_exec_systemcallerrornumber(Manager *m) { + #if HAVE_SECCOMP ++ int r; ++ + if (!is_seccomp_available()) { + log_notice("Seccomp not available, skipping %s", __func__); + return; + } + ++ r = find_binary("python3", NULL); ++ if (r < 0) { ++ log_notice_errno(r, "Skipping %s, could not find python3 binary: %m", __func__); ++ return; ++ } ++ + test(m, "exec-systemcallerrornumber-name.service", errno_from_name("EACCES"), CLD_EXITED); + test(m, "exec-systemcallerrornumber-number.service", 255, CLD_EXITED); + #endif diff --git a/SOURCES/0359-test-execute-skip-several-tests-when-running-in-cont.patch b/SOURCES/0359-test-execute-skip-several-tests-when-running-in-cont.patch new file mode 100644 index 0000000..4340dc9 --- /dev/null +++ b/SOURCES/0359-test-execute-skip-several-tests-when-running-in-cont.patch @@ -0,0 +1,43 @@ +From 127c5a52752f34ac6dbf2e818f036308d94ea81f Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Fri, 14 Sep 2018 15:47:42 +0900 +Subject: [PATCH] test-execute: skip several tests when running in container + +(cherry picked from commit 642d1a6d6e98204ade25816bcc429cb67df92a29) +(cherry picked from commit 3a8ebd888d97c9f83df724264b47475e315d1a20) + +Resolves: #1836979 +--- + src/test/test-execute.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/test/test-execute.c b/src/test/test-execute.c +index af64427bc7..637ffe96bb 100644 +--- a/src/test/test-execute.c ++++ b/src/test/test-execute.c +@@ -616,14 +616,24 @@ static void test_exec_privatenetwork(Manager *m) { + + static void test_exec_oomscoreadjust(Manager *m) { + test(m, "exec-oomscoreadjust-positive.service", 0, CLD_EXITED); ++ ++ if (detect_container() > 0) { ++ log_notice("Testing in container, skipping remaining tests in %s", __func__); ++ return; ++ } + test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED); + } + + static void test_exec_ioschedulingclass(Manager *m) { + test(m, "exec-ioschedulingclass-none.service", 0, CLD_EXITED); + test(m, "exec-ioschedulingclass-idle.service", 0, CLD_EXITED); +- test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED); + test(m, "exec-ioschedulingclass-best-effort.service", 0, CLD_EXITED); ++ ++ if (detect_container() > 0) { ++ log_notice("Testing in container, skipping remaining tests in %s", __func__); ++ return; ++ } ++ test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED); + } + + static void test_exec_unsetenvironment(Manager *m) { diff --git a/SOURCES/0360-test-introduce-test_is_running_from_builddir.patch b/SOURCES/0360-test-introduce-test_is_running_from_builddir.patch new file mode 100644 index 0000000..973e0f8 --- /dev/null +++ b/SOURCES/0360-test-introduce-test_is_running_from_builddir.patch @@ -0,0 +1,71 @@ +From b97351958572028b6c23945bbf2d8f509f2e29a2 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 11 Sep 2018 09:17:22 +0900 +Subject: [PATCH] test: introduce test_is_running_from_builddir() + +(cherry picked from commit 8cb10a4f4dabc508a04f76ea55f23ef517881b61) +(cherry picked from commit 4fa54d7a72600788349fc363b7814bb52849b5e6) + +Resolves: #1836979 +--- + src/shared/tests.c | 23 ++++++++++++++++++++--- + src/shared/tests.h | 1 + + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/src/shared/tests.c b/src/shared/tests.c +index b10343650f..c77eb00924 100644 +--- a/src/shared/tests.c ++++ b/src/shared/tests.c +@@ -19,6 +19,24 @@ char* setup_fake_runtime_dir(void) { + return p; + } + ++bool test_is_running_from_builddir(char **exedir) { ++ _cleanup_free_ char *s = NULL; ++ bool r; ++ ++ /* Check if we're running from the builddir. Optionally, this returns ++ * the path to the directory where the binary is located. */ ++ ++ assert_se(readlink_and_make_absolute("/proc/self/exe", &s) >= 0); ++ r = path_startswith(s, ABS_BUILD_DIR); ++ ++ if (exedir) { ++ dirname(s); ++ *exedir = TAKE_PTR(s); ++ } ++ ++ return r; ++} ++ + const char* get_testdata_dir(const char *suffix) { + const char *env; + /* convenience: caller does not need to free result */ +@@ -35,14 +53,13 @@ const char* get_testdata_dir(const char *suffix) { + strncpy(testdir, env, sizeof(testdir) - 1); + } else { + _cleanup_free_ char *exedir = NULL; +- assert_se(readlink_and_make_absolute("/proc/self/exe", &exedir) >= 0); + + /* Check if we're running from the builddir. If so, use the compiled in path. */ +- if (path_startswith(exedir, ABS_BUILD_DIR)) ++ if (test_is_running_from_builddir(&exedir)) + assert_se(snprintf(testdir, sizeof(testdir), "%s/test", ABS_SRC_DIR) > 0); + else + /* Try relative path, according to the install-test layout */ +- assert_se(snprintf(testdir, sizeof(testdir), "%s/testdata", dirname(exedir)) > 0); ++ assert_se(snprintf(testdir, sizeof(testdir), "%s/testdata", exedir) > 0); + + /* test this without the suffix, as it may contain a glob */ + if (access(testdir, F_OK) < 0) { +diff --git a/src/shared/tests.h b/src/shared/tests.h +index cad21169f8..7f45c32d32 100644 +--- a/src/shared/tests.h ++++ b/src/shared/tests.h +@@ -2,5 +2,6 @@ + #pragma once + + char* setup_fake_runtime_dir(void); ++bool test_is_running_from_builddir(char **exedir); + const char* get_testdata_dir(const char *suffix); + void test_setup_logging(int level); diff --git a/SOURCES/0361-test-make-test-catalog-relocatable.patch b/SOURCES/0361-test-make-test-catalog-relocatable.patch new file mode 100644 index 0000000..3b1cf88 --- /dev/null +++ b/SOURCES/0361-test-make-test-catalog-relocatable.patch @@ -0,0 +1,104 @@ +From 4b54464394c7cddf7e8335d976632bae1240846a Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 11 Sep 2018 09:18:33 +0900 +Subject: [PATCH] test: make test-catalog relocatable + +Fixes #10045. + +(cherry picked from commit d9b6baa69968132d33e4ad8627c7fe0bd527c859) +(cherry picked from commit 444ad721dc163d4952bb35a0b061e57c91bfc9ff) + +Resolves: #1836979 +--- + catalog/meson.build | 1 - + src/journal/test-catalog.c | 27 +++++++++++++++++++-------- + src/test/meson.build | 2 +- + 3 files changed, 20 insertions(+), 10 deletions(-) + +diff --git a/catalog/meson.build b/catalog/meson.build +index 1b13150894..3db8e390f2 100644 +--- a/catalog/meson.build ++++ b/catalog/meson.build +@@ -17,7 +17,6 @@ in_files = ''' + + support_url = get_option('support-url') + support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url) +-build_catalog_dir = meson.current_build_dir() + + foreach file : in_files + custom_target( +diff --git a/src/journal/test-catalog.c b/src/journal/test-catalog.c +index 8eae993780..0c4da29f31 100644 +--- a/src/journal/test-catalog.c ++++ b/src/journal/test-catalog.c +@@ -14,14 +14,13 @@ + #include "fileio.h" + #include "log.h" + #include "macro.h" ++#include "path-util.h" + #include "string-util.h" ++#include "strv.h" ++#include "tests.h" + #include "util.h" + +-static const char *catalog_dirs[] = { +- CATALOG_DIR, +- NULL, +-}; +- ++static char** catalog_dirs = NULL; + static const char *no_catalog_dirs[] = { + "/bin/hopefully/with/no/catalog", + NULL +@@ -167,8 +166,8 @@ static void test_catalog_update(const char *database) { + assert_se(r == 0); + + /* Make sure that we at least have some files loaded or the +- catalog_list below will fail. */ +- r = catalog_update(database, NULL, catalog_dirs); ++ * catalog_list below will fail. */ ++ r = catalog_update(database, NULL, (const char * const *) catalog_dirs); + assert_se(r == 0); + } + +@@ -202,14 +201,26 @@ static void test_catalog_file_lang(void) { + + int main(int argc, char *argv[]) { + _cleanup_(unlink_tempfilep) char database[] = "/tmp/test-catalog.XXXXXX"; +- _cleanup_free_ char *text = NULL; ++ _cleanup_free_ char *text = NULL, *catalog_dir = NULL; + int r; + + setlocale(LC_ALL, "de_DE.UTF-8"); + ++ log_set_max_level(LOG_DEBUG); + log_parse_environment(); + log_open(); + ++ /* If test-catalog is located at the build directory, then use catalogs in that. ++ * If it is not, e.g. installed by systemd-tests package, then use installed catalogs. */ ++ if (test_is_running_from_builddir(NULL)) { ++ assert_se(catalog_dir = path_join(NULL, ABS_BUILD_DIR, "catalog")); ++ catalog_dirs = STRV_MAKE(catalog_dir); ++ } else ++ catalog_dirs = STRV_MAKE(CATALOG_DIR); ++ ++ assert_se(access(catalog_dirs[0], F_OK) >= 0); ++ log_notice("Using catalog directory '%s'", catalog_dirs[0]); ++ + test_catalog_file_lang(); + + test_catalog_import_invalid(); +diff --git a/src/test/meson.build b/src/test/meson.build +index 4259421f98..ead000e30c 100644 +--- a/src/test/meson.build ++++ b/src/test/meson.build +@@ -766,7 +766,7 @@ tests += [ + [threads, + libxz, + liblz4], +- '', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)], ++ '', '', '-DCATALOG_DIR="@0@"'.format(catalogdir)], + + [['src/journal/test-compress.c'], + [libjournal_core, diff --git a/SOURCES/0362-test-parallelize-tasks-in-TEST-24-UNIT-TESTS.patch b/SOURCES/0362-test-parallelize-tasks-in-TEST-24-UNIT-TESTS.patch new file mode 100644 index 0000000..4deb641 --- /dev/null +++ b/SOURCES/0362-test-parallelize-tasks-in-TEST-24-UNIT-TESTS.patch @@ -0,0 +1,138 @@ +From 0b08d53cb68f008610722773ee4e9188b8e67d06 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 5 Mar 2019 13:50:28 +0100 +Subject: [PATCH] test: parallelize tasks in TEST-24-UNIT-TESTS + +(cherry picked from commit 2f2a0454efd07644a4e0ccb3f00f1db2d7043391) +(cherry picked from commit c06e3ad98d2d6bc03d3ed2cdeb1e73283702ef3a) + +Resolves: #1836979 +--- + test/TEST-24-UNIT-TESTS/test.sh | 2 + + test/TEST-24-UNIT-TESTS/testsuite.sh | 97 +++++++++++++++++++++------- + 2 files changed, 77 insertions(+), 22 deletions(-) + +diff --git a/test/TEST-24-UNIT-TESTS/test.sh b/test/TEST-24-UNIT-TESTS/test.sh +index 014ee52277..fc8c89fe0a 100755 +--- a/test/TEST-24-UNIT-TESTS/test.sh ++++ b/test/TEST-24-UNIT-TESTS/test.sh +@@ -78,6 +78,8 @@ test_setup() { + setup_basic_environment + install_keymaps yes + install_zoneinfo ++ # Install nproc to determine # of CPUs for correct parallelization ++ inst_binary nproc + + # setup the testsuite service + cat >$initdir/etc/systemd/system/testsuite.service < /$NAME.log 2>&1 +- ret=$? +- if (( $ret && $ret != 77 )); then +- echo "$NAME failed with $ret" +- echo $NAME >> /failed-tests +- echo "--- $NAME begin ---" >> /failed +- cat /$NAME.log >> /failed +- echo "--- $NAME end ---" >> /failed +- elif (( $ret == 77 )); then +- echo "$NAME skipped" +- echo $NAME >> /skipped-tests +- echo "--- $NAME begin ---" >> /skipped +- cat /$NAME.log >> /skipped +- echo "--- $NAME end ---" >> /skipped ++NPROC=$(nproc) ++MAX_QUEUE_SIZE=${NPROC:-2} ++IFS=$'\n' TEST_LIST=($(ls /usr/lib/systemd/tests/test-*)) ++ ++# Check & report test results ++# Arguments: ++# $1: test path ++# $2: test exit code ++function report_result() { ++ if [[ $# -ne 2 ]]; then ++ echo >&2 "check_result: missing arguments" ++ exit 1 ++ fi ++ ++ local name="${1##*/}" ++ local ret=$2 ++ ++ if [[ $ret -ne 0 && $ret != 77 ]]; then ++ echo "$name failed with $ret" ++ echo "$name" >> /failed-tests ++ { ++ echo "--- $name begin ---" ++ cat "/$name.log" ++ echo "--- $name end ---" ++ } >> /failed ++ elif [[ $ret == 77 ]]; then ++ echo "$name skipped" ++ echo "$name" >> /skipped-tests ++ { ++ echo "--- $name begin ---" ++ cat "/$name.log" ++ echo "--- $name end ---" ++ } >> /skipped + else +- echo "$NAME OK" +- echo $NAME >> /testok ++ echo "$name OK" ++ echo "$name" >> /testok ++ fi ++ ++ systemd-cat echo "--- $name ---" ++ systemd-cat cat "/$name.log" ++} ++ ++# Associative array for running tasks, where running[test-path]=PID ++declare -A running=() ++for task in "${TEST_LIST[@]}"; do ++ # If there's MAX_QUEUE_SIZE running tasks, keep checking the running queue ++ # until one of the tasks finishes, so we can replace it. ++ while [[ ${#running[@]} -ge $MAX_QUEUE_SIZE ]]; do ++ for key in "${!running[@]}"; do ++ if ! kill -0 ${running[$key]} &>/dev/null; then ++ # Task has finished, report its result and drop it from the queue ++ wait ${running[$key]} ++ ec=$? ++ report_result "$key" $ec ++ unset running["$key"] ++ # Break from inner for loop and outer while loop to skip ++ # the sleep below when we find a free slot in the queue ++ break 2 ++ fi ++ done ++ ++ # Precisely* calculated constant to keep the spinlock from burning the CPU(s) ++ sleep 0.01 ++ done ++ ++ if [[ -x $task ]]; then ++ log_file="/${task##*/}.log" ++ $task &> "$log_file" & ++ running[$task]=$! + fi ++done + +- systemd-cat echo "--- $NAME ---" +- systemd-cat cat /$NAME.log ++# Wait for remaining running tasks ++for key in "${!running[@]}"; do ++ wait ${running[$key]} ++ ec=$? ++ report_result "$key" $ec ++ unset running["$key"] + done + + exit 0 diff --git a/SOURCES/0363-test-try-to-determine-QEMU_SMP-dynamically.patch b/SOURCES/0363-test-try-to-determine-QEMU_SMP-dynamically.patch new file mode 100644 index 0000000..714e6ec --- /dev/null +++ b/SOURCES/0363-test-try-to-determine-QEMU_SMP-dynamically.patch @@ -0,0 +1,42 @@ +From c83025b14c1ec1aead2e6940e023c098ccc8fa9c Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 5 Mar 2019 16:08:00 +0100 +Subject: [PATCH] test: try to determine QEMU_SMP dynamically + +If the QEMU_SMP value has not been explicitly set, try to determine it +from the number of online CPUs using the nproc utility. If this approach +fails, fall back to the default value QEMU_SMP=1. + +This change should significantly help when running integration tests +under QEMU on multicore systems. + +(cherry picked from commit 5bfb2a93a4a36bba0d24199553dcda6e560cbb75) +(cherry picked from commit dd166ab28360ceeb821d7b6d04e3c360b9023896) + +Resolves: #1836979 +--- + test/test-functions | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/test/test-functions b/test/test-functions +index 0938e6e826..3f1c327f3c 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -120,7 +120,16 @@ run_qemu() { + fi + fi + +- [ "$QEMU_SMP" ] || QEMU_SMP=1 ++ # If QEMU_SMP was not explicitly set, try to determine the value 'dynamically' ++ # i.e. use the number of online CPUs on the host machine. If the nproc utility ++ # is not installed or there's some other error when calling it, fall back ++ # to the original value (QEMU_SMP=1). ++ if ! [ "$QEMU_SMP" ]; then ++ if ! QEMU_SMP=$(nproc); then ++ dwarn "nproc utility is not installed, falling back to QEMU_SMP=1" ++ QEMU_SMP=1 ++ fi ++ fi + + find_qemu_bin || return 1 + diff --git a/SOURCES/0364-test-store-coredumps-in-journal.patch b/SOURCES/0364-test-store-coredumps-in-journal.patch new file mode 100644 index 0000000..f9c3db9 --- /dev/null +++ b/SOURCES/0364-test-store-coredumps-in-journal.patch @@ -0,0 +1,32 @@ +From c8e3d9e23d99f2f0f01bd5f367f6bce37d2f04b9 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 13 Aug 2019 00:14:54 +0200 +Subject: [PATCH] test: store coredumps in journal + +To make debugging much easier, especially for crashes in tests under +QEMU, let's store the entire coredump bundle in the systemd journal, +which is usually kept around by various CIs. Right now, we usually end +up with a journal, but without the coredump itself, which is pretty +useless. + +(cherry picked from commit 215bffe1b8d7cb72fe9f72ed53682d52d5c2a9c5) +(cherry picked from commit cac1e15554b8e3f102e00ac802cff7100b1def22) + +Resolves: #1836979 +--- + test/test-functions | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/test/test-functions b/test/test-functions +index 3f1c327f3c..7c4230b078 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -420,6 +420,8 @@ install_systemd() { + + # enable debug logging in PID1 + echo LogLevel=debug >> $initdir/etc/systemd/system.conf ++ # store coredumps in journal ++ echo Storage=journal >> $initdir/etc/systemd/coredump.conf + } + + get_ldpath() { diff --git a/SOURCES/0365-udev-rules-make-tape-changers-also-apprear-in-dev-ta.patch b/SOURCES/0365-udev-rules-make-tape-changers-also-apprear-in-dev-ta.patch new file mode 100644 index 0000000..0604522 --- /dev/null +++ b/SOURCES/0365-udev-rules-make-tape-changers-also-apprear-in-dev-ta.patch @@ -0,0 +1,57 @@ +From a4035d7ebcb2bbc173a626f69798bedba03978b9 Mon Sep 17 00:00:00 2001 +From: Joerg Steffens +Date: Tue, 21 Nov 2017 12:21:49 +0100 +Subject: [PATCH] udev-rules: make tape-changers also apprear in + /dev/tape/by-path/ + +It is important to be able to access tape changer ("Medium Changers") by +persistant name. +While tape devices can be accessed via /dev/tape/by-id/ and +/dev/tape/by-path/, tape-changers could only be accessed by +/dev/tape/by-id/. +However, in some cases, especially when accessing Amazon Webservice +Storage Gateway VTLs (or accessing iSCSI VTLs in general?) this does not +work, as all tape devices and the tape changer have the same ENV{ID_SERIAL}. +The results is, that only the last device is available in +/dev/tape/by-id/, as the former devices have been overwritten. + +As this behavior is hard to change without breaking consistentcy, +this additional device in /dev/tape/by-path/ can be used to access the medium changes. +The tape devices can also be accessed by this path. + +The content of the directory will now look like: + + # SCSI tape device, rewind (unchanged) + /dev/tape/by-path/$env{ID_PATH} -> ../../st* + + # SCSI tape device, no-rewind (unchanged) + /dev/tape/by-path/$env{ID_PATH}-nst -> ../../nst* + + # SCSI tape changer device (newly added) + /dev/tape/by-path/$env{ID_PATH}-changer -> ../../sg* + +Tape devices and tape changer have different ID_PATHs. +SCSI tape changer get the suffix "-changer" +to make them better distinguishable from tape devices. + +(cherry picked from commit 7f8ddf96a25162f06bd94a684cf700c128d18142) +(cherry picked from commit f60e89ea4c38c11a9d0c1e642c0a78faa32aca56) +Resolves: #1836981 +--- + rules/60-persistent-storage-tape.rules | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/rules/60-persistent-storage-tape.rules b/rules/60-persistent-storage-tape.rules +index b604864ee8..0575f308df 100644 +--- a/rules/60-persistent-storage-tape.rules ++++ b/rules/60-persistent-storage-tape.rules +@@ -9,6 +9,9 @@ ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_t + SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $devnode", \ + SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" + ++SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{builtin}="path_id", \ ++ SYMLINK+="tape/by-path/$env{ID_PATH}-changer" ++ + SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end" + + KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" diff --git a/SOURCES/0366-nspawn-move-payload-to-sub-cgroup-first-then-sync-cg.patch b/SOURCES/0366-nspawn-move-payload-to-sub-cgroup-first-then-sync-cg.patch new file mode 100644 index 0000000..fdb6bbf --- /dev/null +++ b/SOURCES/0366-nspawn-move-payload-to-sub-cgroup-first-then-sync-cg.patch @@ -0,0 +1,37 @@ +From 63e2cd09f2c266d9a67937f2d1c13d518c988312 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 5 Mar 2019 18:57:53 +0100 +Subject: [PATCH] nspawn: move payload to sub-cgroup first, then sync cgroup + trees + +if we sync the legacy and unified trees before moving to the right +subcgroup then ultimately the cgroup paths in the hierarchies will be +out-of-sync... Hence, let's move the payload first, and sync then. + +Addresses: https://github.com/systemd/systemd/pull/9762#issuecomment-441187979 +(cherry picked from commit 27da7ef0d09e00eae821f3ef26e1a666fe7aa087) +(cherry picked from commit 8ee1465520ad49892a0a378626ef93abc03f4d4e) + +Resolves: #1837423 +--- + src/nspawn/nspawn.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index 08255b5724..8cb7591f0e 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -3960,11 +3960,11 @@ static int run(int master, + } else if (arg_slice || arg_property) + log_notice("Machine and scope registration turned off, --slice= and --property= settings will have no effect."); + +- r = sync_cgroup(*pid, arg_unified_cgroup_hierarchy, arg_uid_shift); ++ r = create_subcgroup(*pid, arg_keep_unit, arg_unified_cgroup_hierarchy); + if (r < 0) + return r; + +- r = create_subcgroup(*pid, arg_keep_unit, arg_unified_cgroup_hierarchy); ++ r = sync_cgroup(*pid, arg_unified_cgroup_hierarchy, arg_uid_shift); + if (r < 0) + return r; + diff --git a/SOURCES/0367-nspawn-chown-the-legacy-hierarchy-when-it-s-used-in-.patch b/SOURCES/0367-nspawn-chown-the-legacy-hierarchy-when-it-s-used-in-.patch new file mode 100644 index 0000000..eab0e93 --- /dev/null +++ b/SOURCES/0367-nspawn-chown-the-legacy-hierarchy-when-it-s-used-in-.patch @@ -0,0 +1,32 @@ +From 9b40608e772dac4e0fa7b5be3a283360efb282e7 Mon Sep 17 00:00:00 2001 +From: Evgeny Vereshchagin +Date: Mon, 17 Sep 2018 07:12:38 +0000 +Subject: [PATCH] nspawn: chown() the legacy hierarchy when it's used in a + container + +This is a follow-up to 720f0a2f3c928cc9379501a52146be9fbb4d9be2. + +Closes https://github.com/systemd/systemd/issues/10026 +Closes https://github.com/systemd/systemd/issues/9563 + +(cherry picked from commit 89f180201cd8c0f3ce5cb6e8dd7e2b3cbcf71527) +(cherry picked from commit f4a34d97bd7e1564a51f590df591cb31a1a3f333) + +Resolves: #1837423 +--- + src/nspawn/nspawn-cgroup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c +index d8a39a6959..a231622e29 100644 +--- a/src/nspawn/nspawn-cgroup.c ++++ b/src/nspawn/nspawn-cgroup.c +@@ -55,7 +55,7 @@ int chown_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) { + if (r < 0) + return log_error_errno(r, "Failed to chown() cgroup %s: %m", fs); + +- if (unified_requested == CGROUP_UNIFIED_SYSTEMD) { ++ if (unified_requested == CGROUP_UNIFIED_SYSTEMD || (unified_requested == CGROUP_UNIFIED_NONE && cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER) > 0)) { + _cleanup_free_ char *lfs = NULL; + /* Always propagate access rights from unified to legacy controller */ + diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 4da596e..c09114d 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -13,7 +13,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 239 -Release: 30%{?dist} +Release: 31%{?dist}.2 # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: System and Service Manager @@ -395,6 +395,28 @@ Patch0342: 0342-cryptsetup-Treat-key-file-errors-as-a-failed-passwor.patch Patch0343: 0343-pid1-fix-the-names-of-AllowedCPUs-and-AllowedMemoryN.patch Patch0344: 0344-core-fix-re-realization-of-cgroup-siblings.patch Patch0345: 0345-basic-use-comma-as-separator-in-cpuset-cgroup-cpu-ra.patch +Patch0346: 0346-swap-finish-the-secondary-swap-units-jobs-if-deactiv.patch +Patch0347: 0347-pid1-add-new-kernel-cmdline-arg-systemd.cpu_affinity.patch +Patch0348: 0348-sd-journal-close-journal-files-that-were-deleted-by-.patch +Patch0349: 0349-sd-journal-remove-the-dead-code-and-actually-fix-146.patch +Patch0350: 0350-test-do-not-use-global-variable-to-pass-error.patch +Patch0351: 0351-test-install-libraries-required-by-tests.patch +Patch0352: 0352-test-introduce-install_zoneinfo.patch +Patch0353: 0353-test-replace-duplicated-Makefile-by-symbolic-link.patch +Patch0354: 0354-test-add-paths-of-keymaps-in-install_keymaps.patch +Patch0355: 0355-test-make-install_keymaps-optionally-install-more-ke.patch +Patch0356: 0356-test-fs-util-skip-some-tests-when-running-in-unprivi.patch +Patch0357: 0357-test-process-util-skip-several-verifications-when-ru.patch +Patch0358: 0358-test-execute-also-check-python3-is-installed-or-not.patch +Patch0359: 0359-test-execute-skip-several-tests-when-running-in-cont.patch +Patch0360: 0360-test-introduce-test_is_running_from_builddir.patch +Patch0361: 0361-test-make-test-catalog-relocatable.patch +Patch0362: 0362-test-parallelize-tasks-in-TEST-24-UNIT-TESTS.patch +Patch0363: 0363-test-try-to-determine-QEMU_SMP-dynamically.patch +Patch0364: 0364-test-store-coredumps-in-journal.patch +Patch0365: 0365-udev-rules-make-tape-changers-also-apprear-in-dev-ta.patch +Patch0366: 0366-nspawn-move-payload-to-sub-cgroup-first-then-sync-cg.patch +Patch0367: 0367-nspawn-chown-the-legacy-hierarchy-when-it-s-used-in-.patch %ifarch %{ix86} x86_64 aarch64 @@ -1019,6 +1041,34 @@ fi %files tests -f .file-list-tests %changelog +* Fri May 22 2020 systemd maintenance team - 239-31.2 +- test: do not use global variable to pass error (#1836979) +- test: install libraries required by tests (#1836979) +- test: introduce install_zoneinfo() (#1836979) +- test: replace duplicated Makefile by symbolic link (#1836979) +- test: add paths of keymaps in install_keymaps() (#1836979) +- test: make install_keymaps() optionally install more keymaps (#1836979) +- test-fs-util: skip some tests when running in unprivileged container (#1836979) +- test-process-util: skip several verifications when running in unprivileged container (#1836979) +- test-execute: also check python3 is installed or not (#1836979) +- test-execute: skip several tests when running in container (#1836979) +- test: introduce test_is_running_from_builddir() (#1836979) +- test: make test-catalog relocatable (#1836979) +- test: parallelize tasks in TEST-24-UNIT-TESTS (#1836979) +- test: try to determine QEMU_SMP dynamically (#1836979) +- test: store coredumps in journal (#1836979) +- udev-rules: make tape-changers also apprear in /dev/tape/by-path/ (#1836981) +- nspawn: move payload to sub-cgroup first, then sync cgroup trees (#1837423) +- nspawn: chown() the legacy hierarchy when it's used in a container (#1837423) + +* Mon May 11 2020 systemd maintenance team - 239-31.1 +- sd-journal: close journal files that were deleted by journald before we've setup inotify watch (#1826217) +- sd-journal: remove the dead code and actually fix #14695 (#1826217) + +* Mon Apr 27 2020 systemd maintenance team - 239-31 +- swap: finish the secondary swap units' jobs if deactivation of the primary swap unit fails (#1821372) +- pid1: add new kernel cmdline arg systemd.cpu_affinity= (#1827621) + * Wed Apr 15 2020 systemd maintenance team - 239-30 - pid1: fix the names of AllowedCPUs= and AllowedMemoryNodes= (#1824129) - core: fix re-realization of cgroup siblings (#1824129)