mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
Merge pull request #8758 from keszybz/improved-slice-checks
Improved slice checks
This commit is contained in:
commit
6360b8ff83
@ -3404,14 +3404,23 @@ int config_parse_delegate(
|
|||||||
void *userdata) {
|
void *userdata) {
|
||||||
|
|
||||||
CGroupContext *c = data;
|
CGroupContext *c = data;
|
||||||
|
UnitType t;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
t = unit_name_to_type(unit);
|
||||||
|
assert(t != _UNIT_TYPE_INVALID);
|
||||||
|
|
||||||
|
if (!unit_vtable[t]->can_delegate) {
|
||||||
|
log_syntax(unit, LOG_ERR, filename, line, 0, "Delegate= setting not supported for this unit type, ignoring.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* We either accept a boolean value, which may be used to turn on delegation for all controllers, or turn it
|
/* We either accept a boolean value, which may be used to turn on delegation for all controllers, or turn it
|
||||||
* off for all. Or it takes a list of controller names, in which case we add the specified controllers to the
|
* off for all. Or it takes a list of controller names, in which case we add the specified controllers to the
|
||||||
* mask to delegate. */
|
* mask to delegate. */
|
||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
c->delegate = true;
|
c->delegate = false;
|
||||||
c->delegate_controllers = 0;
|
c->delegate_controllers = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3432,7 +3441,7 @@ int config_parse_delegate(
|
|||||||
return log_oom();
|
return log_oom();
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
|
log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cc = cgroup_controller_from_string(word);
|
cc = cgroup_controller_from_string(word);
|
||||||
|
Loading…
Reference in New Issue
Block a user