transaction: downgrade warnings about wanted unit which are not found (#1278264)

Resolves: #1278264
This commit is contained in:
Jan Synacek 2016-01-25 10:18:03 +01:00
parent f8f052cc58
commit 566578510f
3 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From 11600220d6fa867b0ed4371be61cc0976779d777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 30 Nov 2015 21:00:04 -0500
Subject: [PATCH 2/5] core: do not warn about Wants depencencies on masked
units
When masking is used to prevent a unit from being loaded,
every transaction with dependent units would generate a warning.
Downgrade this warning to debug level.
transaction_add_job_and_dependencies only generated a few return
values found in the table in bus_common_errors.c, and EADDRNOTAVAIL
is not one of them, so do not try to suppress EADDRNOTAVAIL.
https://bugzilla.redhat.com/show_bug.cgi?id=1278264
(cherry picked from commit e43cec8e055da9aaa65c8553c436bdad3e27ddf1)
Resolves: #1278264
---
src/core/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 090103f..38836ef 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -964,7 +964,7 @@ int transaction_add_job_and_dependencies(
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, false, ignore_order, e);
if (r < 0) {
log_unit_full(dep,
- r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_WARNING, r,
+ r == -EBADR /* unit masked */ ? LOG_DEBUG : LOG_WARNING, r,
"Cannot add dependency job, ignoring: %s",
bus_error_message(e, r));
sd_bus_error_free(e);
--
2.5.0

View File

@ -0,0 +1,44 @@
From 93bd765797dab24b98d06a8043e297d6aaa171d4 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Thu, 14 Jan 2016 09:25:18 +0100
Subject: [PATCH 3/5] transaction: downgrade warnings about wanted unit which
are not found
If a unit was pulled by a Wants= dependency but its unit file was not
present then we logged this as an error.
However Wants= might be used to configure a soft/optional dependency
on another unit, ie. start an optional service only if it's installed
otherwise simply skip it. In this case emitting an error doesn't look
appropriate.
But it's still an error if the optional dependency exists but its
activation fails for any reasons.
(cherry picked from commit f14637fc19c449502af0209d1862e4f829c5cb47)
Resolves: #1278264
---
src/core/transaction.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 38836ef..e5cfb9a 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -963,9 +963,10 @@ int transaction_add_job_and_dependencies(
SET_FOREACH(dep, ret->unit->dependencies[UNIT_WANTS], i) {
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, false, ignore_order, e);
if (r < 0) {
+ /* unit masked and unit not found are not considered as errors. */
log_unit_full(dep,
- r == -EBADR /* unit masked */ ? LOG_DEBUG : LOG_WARNING, r,
- "Cannot add dependency job, ignoring: %s",
+ r == -EBADR || r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
+ r, "Cannot add dependency job, ignoring: %s",
bus_error_message(e, r));
sd_bus_error_free(e);
}
--
2.5.0

View File

@ -108,6 +108,8 @@ Patch0072: 0072-journalctl-make-sure-journalctl-f-t-unmatched-blocks.patch
Patch0073: 0073-journalctl-don-t-print-No-entries-in-quiet-mode.patch
Patch0074: 0074-sd-device-fix-enumeration-of-devices-without-subsyst.patch
Patch0075: 0075-units-increase-watchdog-timeout-to-3min-for-all-our-.patch
Patch0076: 0076-core-do-not-warn-about-Wants-depencencies-on-masked-.patch
Patch0077: 0077-transaction-downgrade-warnings-about-wanted-unit-whi.patch
Patch997: 0001-Re-apply-walters-unit-patch-for-F23-systemd-v222.patch
Patch998: 0001-Revert-core-mount-add-dependencies-to-dynamically-mo-v222.patch
@ -851,6 +853,7 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
* Mon Jan 25 2016 Jan Synáček <jsynacek@redhat.com> - 222-13
- units: increase watchdog timeout to 3min for all our services
+ Mitigates the problem described in #1300212.
- transaction: downgrade warnings about wanted unit which are not found (#1278264)
* Thu Jan 7 2016 Jan Synáček <jsynacek@redhat.com> - 222-12
- Terminal multiplexers (tmux, screen) are broken in systemd-nspawn containers (#1282626)