m->pin_cgroupfs_fd = -1;
m->console_active_fd = -1;
+
+/// elogind does not support autospawning of vts
+#if 0
m->reserve_vt_fd = -1;
m->n_autovts = 6;
m->reserve_vt = 6;
+#endif // 0
m->remove_ipc = true;
m->inhibit_delay_max = 5 * USEC_PER_SEC;
m->handle_power_key = HANDLE_POWEROFF;
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;
sd_bus_unref(m->bus);
sd_event_unref(m->event);
+/// elogind does not support autospawning of vts
+#if 0
safe_close(m->reserve_vt_fd);
+#endif // 0
manager_shutdown_cgroup(m, true);
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);
}
return 0;
}
+/// UNNEEDED by elogind
+#if 0
static int manager_dispatch_vcsa_udev(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
Manager *m = userdata;
return 0;
}
+#endif // 0
static int manager_dispatch_button_udev(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
static int manager_reserve_vt(Manager *m) {
_cleanup_free_ char *p = NULL;
return 0;
}
+#endif // 0
static int manager_connect_bus(Manager *m) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
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,
}
/* Don't bother watching VCSA devices, if nobody cares */
+/// elogind does not support autospawning of vts
+#if 0
if (m->n_autovts > 0 && m->console_active_fd >= 0) {
m->udev_vcsa_monitor = udev_monitor_new_from_netlink(m->udev, "udev");
if (r < 0)
return r;
}
+#endif // 0
return 0;
}
manager_gc(m, false);
/* Reserve the special reserved VT */
+/// elogind does not support autospawning of vts
+#if 0
manager_reserve_vt(m);
+#endif // 0
/* And start everything */
HASHMAP_FOREACH(seat, m->seats, i)
}
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[]) {