Blob Blame History Raw
From 3a02c6b4dc75987ef0938beae6fc48e8834aef5a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 20 Jan 2014 13:43:20 +0100
Subject: [PATCH] systemctl: skip native unit file handling if sysv file
 handling already handled everything

Issue pointed out by Colin Guthrie.

(cherry picked from commit 67d6621059085963a2a908a3ea99ced3b0ca789e)
(cherry picked from commit 345151292fb48647cb9e9d5c6b4cd5dff0d0452a)
---
 src/systemctl/systemctl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index e9a7daabad..f18da82930 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4232,6 +4232,11 @@ static int enable_unit(DBusConnection *bus, char **args) {
         if (!args[1])
                 return 0;
 
+        /* If the operation was fully executed by the SysV compat,
+         * let's finish early */
+        if (strv_isempty(mangled_names))
+                return 0;
+
         if (!bus || avoid_bus()) {
                 if (streq(verb, "enable")) {
                         r = unit_file_enable(arg_scope, arg_runtime, arg_root, args+1, arg_force, &changes, &n_changes);