From: Sven Eden Date: Tue, 7 Feb 2017 06:26:17 +0000 (+0100) Subject: Uninstall the cgroup release agent when the manager is shut down. X-Git-Tag: v226.4~1^2~31 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e71f25f7da636b241ba7bdf0fff2ddf9109b9a7f;p=elogind.git Uninstall the cgroup release agent when the manager is shut down. --- diff --git a/src/login/logind.c b/src/login/logind.c index d60241342..5da76a767 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -36,6 +36,7 @@ #include "label.h" #include "label.h" #include "cgroup.h" +#include "virt.h" static void manager_free(Manager *m); @@ -206,6 +207,12 @@ static void manager_free(Manager *m) { safe_close(m->reserve_vt_fd); #endif // 0 + /* Avoid the creation of new processes forked by the + * kernel; at this point, we will not listen to the + * signals anyway */ + if (detect_container(NULL) <= 0) + (void) cg_uninstall_release_agent(ELOGIND_CGROUP_CONTROLLER); + manager_shutdown_cgroup(m, true); strv_free(m->kill_only_users);