chiark / gitweb /
Stop sessions on ReleaseSession
[elogind.git] / src / login / logind.c
index d60241342216549b5d8cc795a76db252a4f86e5b..5da76a76754ec76e6aeac89910766c9fa6b3e3aa 100644 (file)
@@ -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);