richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
803fb7
From 92ff0ade63ae85c6b6170af7b1209aaf37298ab1 Mon Sep 17 00:00:00 2001
803fb7
From: Jan Synacek <jan.synacek@gmail.com>
803fb7
Date: Tue, 24 Jan 2017 04:06:05 +0100
803fb7
Subject: [PATCH] core: improve error message when RefuseManualStart(Stop) is
803fb7
 hit (#5132)
803fb7
803fb7
(cherry picked from commit 7e974e8530e3605db8186bd0c33bf36087e24e22)
803fb7
Resolves: #1026648
803fb7
---
803fb7
 src/core/dbus-unit.c | 2 +-
803fb7
 src/core/dbus.c      | 2 +-
803fb7
 2 files changed, 2 insertions(+), 2 deletions(-)
803fb7
803fb7
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
803fb7
index 89b00e94c..056a17ac1 100644
803fb7
--- a/src/core/dbus-unit.c
803fb7
+++ b/src/core/dbus-unit.c
803fb7
@@ -843,7 +843,7 @@ int bus_unit_queue_job(
803fb7
         if ((type == JOB_START && u->refuse_manual_start) ||
803fb7
             (type == JOB_STOP && u->refuse_manual_stop) ||
803fb7
             ((type == JOB_RESTART || type == JOB_TRY_RESTART) && (u->refuse_manual_start || u->refuse_manual_stop)))
803fb7
-                return sd_bus_error_setf(error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, unit %s may be requested by dependency only.", u->id);
803fb7
+                return sd_bus_error_setf(error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, unit %s may be requested by dependency only (it is configured to refuse manual start/stop).", u->id);
803fb7
 
803fb7
         r = manager_add_job(u->manager, type, u, mode, true, error, &j);
803fb7
         if (r < 0)
803fb7
diff --git a/src/core/dbus.c b/src/core/dbus.c
803fb7
index 29524d49a..0061211fa 100644
803fb7
--- a/src/core/dbus.c
803fb7
+++ b/src/core/dbus.c
803fb7
@@ -187,7 +187,7 @@ static int signal_activation_request(sd_bus *bus, sd_bus_message *message, void
803fb7
                 goto failed;
803fb7
 
803fb7
         if (u->refuse_manual_start) {
803fb7
-                r = sd_bus_error_setf(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, %s may be requested by dependency only.", u->id);
803fb7
+                r = sd_bus_error_setf(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, %s may be requested by dependency only (it is configured to refuse manual start/stop).", u->id);
803fb7
                 goto failed;
803fb7
         }
803fb7