summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-07-04 20:31:18 +0200
committerKay Sievers <kay@vrfy.org>2013-07-04 20:31:18 +0200
commitad929bcc27e2c6c1aa731053e45882686e9babab (patch)
tree6bee9093b59205b665751df7181347ab887841a0 /src/core/main.c
parent0da26ab51bf61e7a14b5e899326cf9cfa513ca52 (diff)
disable the cgroups release agent when shutting down
During shutdown, when we try to clean up all remaining processes, the kernel will fork new agents every time a cgroup runs empty. These new processes cause delays in the final SIGTERM, SIGKILL logic. Apart from that, this should also avoid that the kernel-forked binaries cause unpredictably timed access to the filesystem which we might need to unmount.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 8b8e110f24..ada0f9d94b 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1942,6 +1942,10 @@ finish:
watchdog_close(true);
}
+ /* avoid the creation of new processes forked by the kernel; at this
+ * point, we will not listen to the signals anyway */
+ cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER);
+
execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block);
free(env_block);
log_error("Failed to execute shutdown binary, freezing: %m");