]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: check for no more work after chkconfig
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 9 Feb 2012 09:05:15 +0000 (10:05 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 9 Feb 2012 09:05:15 +0000 (10:05 +0100)
Avoid a bogus message from 'systemctl enable ...' when all units given
are SysV services:
   Warning: unit files do not carry install information. No operation
   executed.

https://bugzilla.redhat.com/show_bug.cgi?id=787407

src/systemctl.c

index 12264f8ba7c709b1231a220ed2602722ba68954e..ab6d126a26deca84c75b72861c310ebb591a0fd5 100644 (file)
@@ -3662,12 +3662,15 @@ static int enable_unit(DBusConnection *bus, char **args) {
         int r;
         DBusError error;
 
-        dbus_error_init(&error);
-
         r = enable_sysv_units(args);
         if (r < 0)
                 return r;
 
+        if (!args[1])
+                return 0;
+
+        dbus_error_init(&error);
+
         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);