dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
21255d
From 65e96327360ab41d44d5383dcecc82a19fad198c Mon Sep 17 00:00:00 2001
bdc714
From: Michal Sekletar <msekleta@redhat.com>
bdc714
Date: Fri, 22 Feb 2019 15:50:55 +0100
bdc714
Subject: [PATCH] logind: don't print warning when user@.service template is
bdc714
 masked
bdc714
bdc714
User instance of systemd is optional feature and if user@.service
bdc714
template is masked then administrator most likely doesn't want --user
bdc714
instances of systemd for logged in users. We don't need to be verbose
bdc714
about it.
bdc714
bdc714
(cherry picked from commit 03b6fa0c5b51b0d39334ff6ba183a3391443bcf6)
bdc714
21255d
Resolves: #1880270
bdc714
---
bdc714
 src/login/logind-user.c | 3 ++-
bdc714
 1 file changed, 2 insertions(+), 1 deletion(-)
bdc714
bdc714
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
bdc714
index 8c4cd54a29..56b8066f12 100644
bdc714
--- a/src/login/logind-user.c
bdc714
+++ b/src/login/logind-user.c
bdc714
@@ -326,7 +326,8 @@ static int user_start_service(User *u) {
bdc714
                         &job;;
bdc714
         if (r < 0)
bdc714
                 /* we don't fail due to this, let's try to continue */
bdc714
-                log_error_errno(r, "Failed to start user service, ignoring: %s", bus_error_message(&error, r));
bdc714
+                log_full_errno(sd_bus_error_has_name(&error, BUS_ERROR_UNIT_MASKED) ? LOG_DEBUG : LOG_WARNING, r,
bdc714
+                               "Failed to start user service '%s', ignoring: %s", u->service, bus_error_message(&error, r));
bdc714
         else
bdc714
                 u->service_job = job;
bdc714