]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: improve error message when starting template without instance 2915/head
authorLukas Nykryn <lnykryn@redhat.com>
Wed, 30 Mar 2016 11:49:50 +0000 (13:49 +0200)
committerLukas Nykryn <lnykryn@redhat.com>
Wed, 30 Mar 2016 11:54:33 +0000 (13:54 +0200)
src/core/manager.c

index 14ee68a3d28f45bd379eef0923a2761ded75f5d4..e739795e7079b2be789a805b853e0e5a1bb3462e 100644 (file)
@@ -1333,8 +1333,12 @@ int manager_load_unit_prepare(
 
         t = unit_name_to_type(name);
 
-        if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid(name, UNIT_NAME_PLAIN|UNIT_NAME_INSTANCE))
+        if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid(name, UNIT_NAME_PLAIN|UNIT_NAME_INSTANCE)) {
+                if (unit_name_is_valid(name, UNIT_NAME_TEMPLATE))
+                        return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s is missing the instance name.", name);
+
                 return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s is not valid.", name);
+        }
 
         ret = manager_get_unit(m, name);
         if (ret) {