From: Michael Stapelberg <michael@stapelberg.de>
Date: Fri, 9 Aug 2013 20:23:31 +0200
Subject: Also redirect to update-rc.d when not using .service

I.e. make systemctl enable rsyslog work (previously, only systemctl
enable rsyslog.service)
---
 src/systemctl/systemctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 754c0f7..f3363c5 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5024,9 +5024,6 @@ static int enable_sysv_units(const char *verb, char **args) {
 
                 name = args[f];
 
-                if (!endswith(name, ".service"))
-                        continue;
-
                 if (path_is_absolute(name))
                         continue;
 
@@ -5060,7 +5057,8 @@ static int enable_sysv_units(const char *verb, char **args) {
                         goto finish;
                 }
 
-                p[strlen(p) - strlen(".service")] = 0;
+                if (endswith(name, ".service"))
+                        p[strlen(p) - strlen(".service")] = 0;
                 found_sysv = access(p, F_OK) >= 0;
                 if (!found_sysv)
                         continue;
