chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgroup: if we do a cgroup operation then do something on all supported controllers
[elogind.git]
/
src
/
core
/
scope.c
diff --git
a/src/core/scope.c
b/src/core/scope.c
index e1a3545dbbcd48fc8eaa2a4dabf537432189ce7b..50e5dbacb4d7fa3936b27d7732cb5341b3b42948 100644
(file)
--- a/
src/core/scope.c
+++ b/
src/core/scope.c
@@
-112,7
+112,7
@@
static int scope_verify(Scope *s) {
if (UNIT(s)->load_state != UNIT_LOADED)
return 0;
if (UNIT(s)->load_state != UNIT_LOADED)
return 0;
- if (set_size(s->pids) <= 0) {
+ if (set_size(s->pids) <= 0
&& UNIT(s)->manager->n_reloading <= 0
) {
log_error_unit(UNIT(s)->id, "Scope %s has no PIDs. Refusing.", UNIT(s)->id);
return -EINVAL;
}
log_error_unit(UNIT(s)->id, "Scope %s has no PIDs. Refusing.", UNIT(s)->id);
return -EINVAL;
}
@@
-239,6
+239,9
@@
static int scope_start(Unit *u) {
assert(s);
assert(s);
+ if (s->state == SCOPE_FAILED)
+ return -EPERM;
+
if (s->state == SCOPE_STOP_SIGTERM ||
s->state == SCOPE_STOP_SIGKILL)
return -EAGAIN;
if (s->state == SCOPE_STOP_SIGTERM ||
s->state == SCOPE_STOP_SIGKILL)
return -EAGAIN;
@@
-254,7
+257,7
@@
static int scope_start(Unit *u) {
return r;
}
return r;
}
- r = cg_attach_many_
with_mask(u->cgroup_mask
, u->cgroup_path, s->pids);
+ r = cg_attach_many_
everywhere(u->manager->cgroup_supported
, u->cgroup_path, s->pids);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-414,7
+417,7
@@
_pure_ static const char *scope_sub_state_to_string(Unit *u) {
static const char* const scope_state_table[_SCOPE_STATE_MAX] = {
[SCOPE_DEAD] = "dead",
static const char* const scope_state_table[_SCOPE_STATE_MAX] = {
[SCOPE_DEAD] = "dead",
- [SCOPE_RUNNING] = "
active
",
+ [SCOPE_RUNNING] = "
running
",
[SCOPE_STOP_SIGTERM] = "stop-sigterm",
[SCOPE_STOP_SIGKILL] = "stop-sigkill",
[SCOPE_FAILED] = "failed",
[SCOPE_STOP_SIGTERM] = "stop-sigterm",
[SCOPE_STOP_SIGKILL] = "stop-sigkill",
[SCOPE_FAILED] = "failed",