summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-03-10 08:33:22 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:23:22 +0100
commit34c7fcb14d705141c71b5b63a2f044a51ffbd92b (patch)
tree6e54cf6831207e49b9199e5d34e9384f8133a865 /src/login
parent6156b4779584b4bf1dc973ce988a34a1bcae1db3 (diff)
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.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind.c8
1 files changed, 8 insertions, 0 deletions
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)