From dfbe9cba258aa37a81f4dd10a4dc6ffe7b583420 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 1 Sep 2023 11:00:07 +0200 Subject: lightdm-arctica-greeter-session: Switch from dbus-launch to dbus-run-session. --- lightdm-arctica-greeter-session | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lightdm-arctica-greeter-session b/lightdm-arctica-greeter-session index 536e0ae..6b34ff0 100755 --- a/lightdm-arctica-greeter-session +++ b/lightdm-arctica-greeter-session @@ -28,9 +28,7 @@ cleanup() exit 0 } -eval `dbus-launch --sh-syntax` - -exec $@ & +exec dbus-run-session $@ & CMD_PID=$! wait $CMD_PID CMD_PID= -- cgit v1.2.3 From 0fd4f87ed76c76f5618d76da17c4c6a9ec3eaf83 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 1 Sep 2023 11:00:22 +0200 Subject: debian/control: Drop dbus-x11 from B-D. --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index 9fe25eb..0f80e04 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Maintainer: Mike Gabriel Standards-Version: 4.1.1 Build-Depends: adwaita-icon-theme, at-spi2-core, - dbus-x11, debhelper (>= 9), dh-autoreconf, fonts-droid-fallback | fonts-droid, -- cgit v1.2.3 From 0c431cad5c72d2e1a7270311c547f441d371187c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 1 Sep 2023 11:01:12 +0200 Subject: src/arctica-greeter.vala: Drop indicator startup via systemctl and spawn_async them directly. This assures DBUS_SESSION_BUS_ADDRESS being shared between greeter and indicators, so DBus session bus operation work out-of-the-box (which is not the case when launching indicators via systemd). --- src/arctica-greeter.vala | 78 +++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 94e58d9..d806bf3 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -1083,9 +1083,6 @@ public class ArcticaGreeter : Object var greeter = new ArcticaGreeter (do_test_mode, do_test_highcontrast, do_test_bigfont); greeter.go(); - string systemd_stderr; - int systemd_exitcode = 0; - Pid nmapplet_pid = 0; var indicator_list = AGSettings.get_strv(AGSettings.KEY_INDICATORS); @@ -1103,7 +1100,7 @@ public class ArcticaGreeter : Object if (update_indicator_list) AGSettings.set_strv(AGSettings.KEY_INDICATORS, indicator_list); - var launched_indicator_services = new List(); + var launched_indicator_service_pids = new List(); if (!do_test_mode) { @@ -1118,6 +1115,8 @@ public class ArcticaGreeter : Object var indicator_service = ""; foreach (unowned string indicator in indicator_list) { + Pid indicator_service_pid = 0; + if ("ug-" in indicator && ! ("." in indicator)) continue; @@ -1132,28 +1131,21 @@ public class ArcticaGreeter : Object /* Start the indicator service */ string[] argv; - Shell.parse_argv ("systemctl --user start %s".printf(indicator_service), out argv); - Process.spawn_sync (null, - argv, - null, - SpawnFlags.SEARCH_PATH, - null, - null, - out systemd_stderr, - out systemd_exitcode); - - if (systemd_exitcode == 0) - { - launched_indicator_services.append(indicator_service); - debug ("Successfully started Indicator Service '%s'", indicator_service); - } - else { - warning ("Systemd failed to start Indicator Service '%s': %s", indicator_service, systemd_stderr); - } + Shell.parse_argv ("/usr/libexec/%s/%s-service".printf(indicator_service, indicator_service), out argv); + Process.spawn_async (null, + argv, + null, + SpawnFlags.SEARCH_PATH, + null, + out indicator_service_pid); + launched_indicator_service_pids.append(indicator_service_pid); + debug ("Successfully started Ayatana Indicator Service '%s' [%d]", indicator_service, indicator_service_pid); } - catch (Error e) { + catch (Error e) + { warning ("Error starting Indicator Service '%s': %s", indicator_service, e.message); } + } /* Make nm-applet hide items the user does not have permissions to interact with */ @@ -1196,33 +1188,23 @@ public class ArcticaGreeter : Object if (!do_test_mode) { - foreach (unowned string indicator_service in launched_indicator_services) + foreach (unowned Pid indicator_service_pid in launched_indicator_service_pids) { + if (indicator_service_pid != 0) + { +#if VALA_0_40 + Posix.kill (indicator_service_pid, Posix.Signal.TERM); +#else + Posix.kill (indicator_service_pid, Posix.SIGTERM); +#endif - try { - /* Stop this indicator service */ - string[] argv; - - Shell.parse_argv ("systemctl --user stop %s".printf(indicator_service), out argv); - Process.spawn_sync (null, - argv, - null, - SpawnFlags.SEARCH_PATH, - null, - null, - out systemd_stderr, - out systemd_exitcode); - - if (systemd_exitcode == 0) - { - debug ("Successfully stopped Indicator Service '%s' via systemd", indicator_service); - } - else { - warning ("Systemd failed to stop Indicator Service '%s': %s", indicator_service, systemd_stderr); - } - } - catch (Error e) { - warning ("Error stopping Indicator Service '%s': %s", indicator_service, e.message); + int status; + Posix.waitpid (indicator_service_pid, out status, 0); + if (Process.if_exited (status)) + debug ("Indicator Service process [%d] exited with return value %d", indicator_service_pid, Process.exit_status (status)); + else + debug ("Indicator Service process [%d] terminated with signal %d", indicator_service_pid, Process.term_sig (status)); + indicator_service_pid = 0; } } -- cgit v1.2.3 From 2561414d56f4c8a3dc6fcad5c53c61020a40d35a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 1 Sep 2023 11:01:43 +0200 Subject: data/50-arctica-greeter.conf.in: Reenable lightdm-arctica-greeter-session greeter-wrapper again. Fixes https://github.com/ArcticaProject/arctica-greeter/issues/36 --- data/50-arctica-greeter.conf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/50-arctica-greeter.conf.in b/data/50-arctica-greeter.conf.in index d19ed15..cac4c59 100644 --- a/data/50-arctica-greeter.conf.in +++ b/data/50-arctica-greeter.conf.in @@ -1,2 +1,3 @@ [Seat:*] greeter-session=arctica-greeter +greeter-wrapper=@pkglibexecdir@/lightdm-arctica-greeter-session -- cgit v1.2.3 From c3d8a7db185dc588191bd3c1b9d2257ac19b4d1f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 11 Sep 2023 17:18:19 +0200 Subject: src/arctica-greeter.vala: Add FIXME for new/direct indicator startup method. --- src/arctica-greeter.vala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index d806bf3..2ede4c5 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -1131,6 +1131,12 @@ public class ArcticaGreeter : Object /* Start the indicator service */ string[] argv; + /* FIXME: This path is rather hard-coded here. + * If it pops up, we need to handle this in + * some path detection fashion similar to + * how we find at-spi-bus-launcher on the file + * system. + */ Shell.parse_argv ("/usr/libexec/%s/%s-service".printf(indicator_service, indicator_service), out argv); Process.spawn_async (null, argv, -- cgit v1.2.3