Blob Blame History Raw
From d953cda9e6b3e41f419b63a35632edc8f769a7d0 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.
---
 src/systemctl/systemctl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index bc9808a..da49da7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4436,6 +4436,11 @@ static int enable_unit(DBusConnection *bus, char **args) {
         if (r < 0)
                 return r;
 
+        /* 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, mangled_names, arg_force, &changes, &n_changes);