core: change top-level drop-in from -.service.d to service.d
Discussed in #13743, the -.service semantic conflicts with the existing root mount and slice names, making this feature not uniformly extensible to all types. Change the name to be <type>.d instead. Updating to this format also extends the top-level dropin to unit types.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
8069017a0f
commit
3e1db806b0
@@ -669,36 +669,6 @@ good:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool service_unit_name_is_valid(const char *name) {
|
||||
_cleanup_free_ char *prefix = NULL, *s = NULL;
|
||||
const char *e, *service_name = name;
|
||||
|
||||
if (!unit_name_is_valid(name, UNIT_NAME_ANY))
|
||||
return false;
|
||||
|
||||
e = endswith(name, ".service");
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
/* 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)) {
|
||||
if (unit_name_to_prefix(name, &prefix) < 0)
|
||||
return false;
|
||||
|
||||
s = strjoin(prefix, ".service");
|
||||
if (!s)
|
||||
return false;
|
||||
|
||||
service_name = s;
|
||||
}
|
||||
|
||||
/* Reject reserved service name(s). */
|
||||
if (streq(service_name, SPECIAL_ROOT_SERVICE))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int slice_build_parent_slice(const char *slice, char **ret) {
|
||||
char *s, *dash;
|
||||
int r;
|
||||
|
||||
Reference in New Issue
Block a user