shared/dropin: support -.service.d/ top level drop-in for service units

Closes #12830
This commit is contained in:
Anita Zhang
2019-10-15 11:14:54 -07:00
parent f18f809c07
commit d272467882
7 changed files with 70 additions and 3 deletions
+7 -2
View File
@@ -678,8 +678,13 @@ bool service_unit_name_is_valid(const char *name) {
/* If it's a template or instance, get the prefix as a service name. */
if (unit_name_is_valid(name, UNIT_NAME_INSTANCE|UNIT_NAME_TEMPLATE)) {
assert_se(unit_name_to_prefix(name, &prefix) == 0);
assert_se(s = strjoin(prefix, ".service"));
if (unit_name_to_prefix(name, &prefix) < 0)
return false;
s = strjoin(prefix, ".service");
if (!s)
return false;
service_name = s;
}