summaryrefslogtreecommitdiff
path: root/src/login/logind.h
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-02-01 08:48:13 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:23:13 +0100
commite19b8719a54c343372e16b462c27f1e84c987b85 (patch)
treec282d4e5d33330d0b6516f5d2274f053b7abe31f /src/login/logind.h
parent059696ac014da265ee2d1b062cd0dc7bee3d2001 (diff)
Handle suspend, shutdown, reboot, etc within elogind
Since we are catching the keys, we might as well just do suspend/reboot/etc handling here. * configure.ac: Get paths of halt and reboot. * Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look in them for hooks to run. * src/login/logind-action.c: Inline the salient bits from systemd's sleep/sleep.c here. * src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own shutdown_or_sleep helper instead of invoking a systemd method. * src/login/logind-action.h: Declare shutdown_or_sleep.
Diffstat (limited to 'src/login/logind.h')
-rw-r--r--src/login/logind.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/login/logind.h b/src/login/logind.h
index 654744bb4..67ebbd88c 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -103,6 +103,8 @@ struct Manager {
* this is != 0 and encodes what is being done */
InhibitWhat action_what;
+/// elogind does all relevant actions on its own. No systemd jobs and units.
+#if 0
/* If a shutdown/suspend was delayed due to a inhibitor this
contains the unit name we are supposed to start after the
delay is over */
@@ -111,6 +113,13 @@ struct Manager {
/* If a shutdown/suspend is currently executed, then this is
* the job of it */
char *action_job;
+#else
+ /* If a shutdown/suspend was delayed due to a inhibitor this
+ contains the action we are supposed to perform after the
+ delay is over */
+ HandleAction pending_action;
+#endif // 0
+
sd_event_source *inhibit_timeout_source;
char *scheduled_shutdown_type;
@@ -184,7 +193,12 @@ int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_err
int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
+/// eloginds own version does the action itself
+#if 0
int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error);
+#else
+int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, HandleAction action, InhibitWhat w, sd_bus_error *error);
+#endif // 0
int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_;