#include "label.h"
#include "label.h"
#include "cgroup.h"
+#include "virt.h"
static void manager_free(Manager *m);
if (r < 0)
goto fail;
+ m->suspend_mode = NULL;
+ m->suspend_state = strv_new("mem", "standby", "freeze", NULL);
+ if (!m->suspend_state)
+ goto fail;
+ m->hibernate_mode = strv_new("platform", "shutdown", NULL);
+ if (!m->hibernate_mode)
+ goto fail;
+ m->hibernate_state = strv_new("disk", NULL);
+ if (!m->hibernate_state)
+ goto fail;
+ m->hybrid_sleep_mode = strv_new("suspend", "platform", "shutdown", NULL);
+ if (!m->hybrid_sleep_mode)
+ goto fail;
+ m->hybrid_sleep_state = strv_new("disk", NULL);
+ if (!m->hybrid_sleep_state)
+ goto fail;
+
m->udev = udev_new();
if (!m->udev)
goto fail;
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);
free(m->scheduled_shutdown_type);
free(m->scheduled_shutdown_tty);
free(m->wall_message);
- free(m->action_job);
+
+ strv_free(m->suspend_mode);
+ strv_free(m->suspend_state);
+ strv_free(m->hibernate_mode);
+ strv_free(m->hibernate_state);
+ strv_free(m->hybrid_sleep_mode);
+ strv_free(m->hybrid_sleep_state);
+
free(m);
}
if (r < 0)
return log_error_errno(r, "Failed to add user enumerator: %m");
+/// elogind does not support systemd action jobs
+#if 0
r = sd_bus_add_match(m->bus,
NULL,
"type='signal',"
match_job_removed, m);
if (r < 0)
log_warning_errno(r, "Failed to add match for JobRemoved: %m");
+#endif // 0
r = sd_bus_add_match(m->bus,
NULL,
}
static int manager_parse_config_file(Manager *m) {
+ const char *unit = NULL, *logind_conf, *sections;
+ FILE *file = NULL;
+ bool relaxed = false, allow_include = false, warn = true;
+
assert(m);
+/// elogind parses its own config file
+#if 0
return config_parse_many("/etc/systemd/logind.conf",
CONF_DIRS_NULSTR("systemd/logind.conf"),
"Login\0",
config_item_perf_lookup, logind_gperf_lookup,
false, m);
+#endif // 0
+
+ logind_conf = getenv("ELOGIND_CONF_FILE");
+ if (!logind_conf)
+ logind_conf = PKGSYSCONFDIR "/logind.conf";
+ sections = "Login\0Sleep\0";
+
+ return config_parse(unit, logind_conf, file, sections,
+ config_item_perf_lookup, logind_gperf_lookup,
+ relaxed, allow_include, warn, m);
}
int main(int argc, char *argv[]) {