chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2db9eca
)
cgroup: after killing cgroup processes, ensure the group is really dead gone. wait...
author
Lennart Poettering
<lennart@poettering.net>
Thu, 18 Nov 2010 01:37:35 +0000
(
02:37
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 18 Nov 2010 01:37:35 +0000
(
02:37
+0100)
src/cgroup-util.c
patch
|
blob
|
history
diff --git
a/src/cgroup-util.c
b/src/cgroup-util.c
index ccc94f86a1fc3eb4c70da24675fca9f742f23763..4cf184ae1b34bfb6e21459e78e87417f86bd5286 100644
(file)
--- a/
src/cgroup-util.c
+++ b/
src/cgroup-util.c
@@
-321,16
+321,17
@@
int cg_kill_recursive_and_wait(const char *controller, const char *path, bool re
assert(controller);
/* This safely kills all processes; first it sends a SIGTERM,
assert(controller);
/* This safely kills all processes; first it sends a SIGTERM,
- * then checks 8 times after 50ms whether the group is
- * now empty, and finally kills everything that is left with
- * SIGKILL */
+ * then checks 8 times after 200ms whether the group is now
+ * empty, then kills everything that is left with SIGKILL and
+ * finally checks 5 times after 200ms each whether the group
+ * is finally empty. */
- for (i = 0; i < 1
0
; i++) {
+ for (i = 0; i < 1
5
; i++) {
int sig, r;
if (i <= 0)
sig = SIGTERM;
int sig, r;
if (i <= 0)
sig = SIGTERM;
- else if (i
>
= 9)
+ else if (i
=
= 9)
sig = SIGKILL;
else
sig = 0;
sig = SIGKILL;
else
sig = 0;
@@
-338,7
+339,7
@@
int cg_kill_recursive_and_wait(const char *controller, const char *path, bool re
if ((r = cg_kill_recursive(controller, path, sig, true, rem, NULL)) <= 0)
return r;
if ((r = cg_kill_recursive(controller, path, sig, true, rem, NULL)) <= 0)
return r;
- usleep(
5
0 * USEC_PER_MSEC);
+ usleep(
20
0 * USEC_PER_MSEC);
}
return 0;
}
return 0;