From 34c7fcb14d705141c71b5b63a2f044a51ffbd92b Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 10 Mar 2017 08:33:22 +0100 Subject: Add mounting of a name=elogind cgroup if no init controller is found. This is done for systems, which init systems are no cgroup controllers. One example is runit on Void Linux. --- src/login/logind.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/login') diff --git a/src/login/logind.c b/src/login/logind.c index 72889535e..23f405993 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 "mount-setup.h" #include "virt.h" static void manager_free(Manager *m); @@ -95,6 +96,13 @@ static Manager *manager_new(void) { if (!m->kill_exclude_users) goto fail; + /* If elogind should be its own controller, mount its cgroup */ + if (streq(ELOGIND_CGROUP_CONTROLLER, "name=elogind")) { + r = mount_setup(true); + if (r < 0) + goto fail; + } + /* Make cgroups */ r = manager_setup_cgroup(m); if (r < 0) -- cgit v1.2.3