+}
+
+static Manager *manager_new(void) {
+ Manager *m;
+ int r;
+
+ m = new0(Manager, 1);
+ if (!m)
+ return NULL;
+
+ m->pin_cgroupfs_fd = -1;
+ m->console_active_fd = -1;
+#if 0 /// UNNEEDED by elogind
+ m->reserve_vt_fd = -1;
+#endif // 0
+
+ m->idle_action_not_before_usec = now(CLOCK_MONOTONIC);
+
+ m->devices = hashmap_new(&string_hash_ops);
+ m->seats = hashmap_new(&string_hash_ops);
+ m->sessions = hashmap_new(&string_hash_ops);
+ m->users = hashmap_new(NULL);
+ m->inhibitors = hashmap_new(&string_hash_ops);
+ m->buttons = hashmap_new(&string_hash_ops);
+
+ m->user_units = hashmap_new(&string_hash_ops);
+ m->session_units = hashmap_new(&string_hash_ops);
+
+ m->test_run = false;
+
+ if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->user_units || !m->session_units)
+ goto fail;
+
+ /* If elogind should be its own controller, mount its cgroup */
+ if (streq(SYSTEMD_CGROUP_CONTROLLER, "name=elogind")) {
+ r = mount_setup(true);
+ if (r < 0)
+ goto fail;
+ }
+
+ /* Make cgroups */
+ r = manager_setup_cgroup(m);
+ if (r < 0)
+ goto fail;
+
+ m->suspend_mode = NULL;
+ m->suspend_state = NULL;
+ m->hibernate_mode = NULL;
+ m->hibernate_state = NULL;
+ m->hybrid_sleep_mode = NULL;
+ m->hybrid_sleep_state = NULL;