[gnome-session/wip/benzea/systemd-user-switch: 19/31] manager: Integrate with systemd startup notification
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session/wip/benzea/systemd-user-switch: 19/31] manager: Integrate with systemd startup notification
- Date: Tue, 30 Jul 2019 08:26:36 +0000 (UTC)
commit 34e80554becae0c4bccd71a2fcd6dc88883cf4d6
Author: Benjamin Berg <bberg redhat com>
Date: Sat Apr 20 01:05:55 2019 +0200
manager: Integrate with systemd startup notification
Doing this allows us to signal delay the startup notification until
basic initialization has been done. It also allows us to signal shutdown
properly.
While at it, signal a bit more information like the current running
phase in the status message.
gnome-session/gsm-manager.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index aef0a74d..b7665bc2 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -44,6 +44,14 @@
#include <systemd/sd-journal.h>
#endif
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#else
+/* So we don't need to add ifdef's everywhere */
+#define sd_notify(u, m) do {} while (0)
+#define sd_notifyf(u, m, ...) do {} while (0)
+#endif
+
#include "gsm-store.h"
#include "gsm-inhibitor.h"
#include "gsm-presence.h"
@@ -1342,11 +1350,18 @@ start_phase (GsmManager *manager)
manager->priv->phase_timeout_id = 0;
}
+ sd_notifyf (0, "STATUS=GNOME Session Manager phase is %s", phase_num_to_name (manager->priv->phase));
+
switch (manager->priv->phase) {
case GSM_MANAGER_PHASE_STARTUP:
case GSM_MANAGER_PHASE_EARLY_INITIALIZATION:
case GSM_MANAGER_PHASE_PRE_DISPLAY_SERVER:
+ do_phase_startup (manager);
+ break;
case GSM_MANAGER_PHASE_DISPLAY_SERVER:
+ sd_notify (0, "READY=1");
+ do_phase_startup (manager);
+ break;
case GSM_MANAGER_PHASE_INITIALIZATION:
case GSM_MANAGER_PHASE_WINDOW_MANAGER:
case GSM_MANAGER_PHASE_PANEL:
@@ -1374,9 +1389,13 @@ start_phase (GsmManager *manager)
do_phase_query_end_session (manager);
break;
case GSM_MANAGER_PHASE_END_SESSION:
+ sd_notify (0, "STOPPING=1");
+
do_phase_end_session (manager);
break;
case GSM_MANAGER_PHASE_EXIT:
+ sd_notify (0, "STOPPING=1");
+
do_phase_exit (manager);
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]