chiark / gitweb /
install: "systemctl enable" should be a nop for template units lacking a DefaultInsta...
[elogind.git] / src / shared / install.c
index 26dbbb6f07c155cbe7b5d092e9e85b2eb31df971..39f5dd2d2d999b72b99697c90a9710b1082f7db9 100644 (file)
@@ -1302,7 +1302,14 @@ static int install_info_symlink_wants(
         assert(i);
         assert(config_path);
 
-        if (unit_name_is_template(i->name) && i->default_instance) {
+        if (unit_name_is_template(i->name)) {
+
+                /* Don't install any symlink if there's no default
+                 * instance configured */
+
+                if (!i->default_instance)
+                        return 0;
+
                 buf = unit_name_replace_instance(i->name, i->default_instance);
                 if (!buf)
                         return -ENOMEM;