[gnome-session/benzea/systemd-gnome-launched-drop-in: 2/2] autostart-app: Place launched applications into a systemd scope



commit 1fd147c7539fc5a747413e64584cb060b834cc0a
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Nov 28 14:56:30 2019 +0100

    autostart-app: Place launched applications into a systemd scope
    
    Try to place launched applications into a systemd scope. This will only
    have an effect on systemd managed sessions, where it will e.g. protect
    gnome-session from OOM actions to a child resulting in a service
    shutdown.

 gnome-session/gsm-autostart-app.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 6fd5915a..3dc34511 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -960,6 +960,10 @@ app_launched (GAppLaunchContext *ctx,
         g_variant_lookup (platform_data, "startup-notification-id", "s", &sn_id);
         app->priv->pid = pid;
         app->priv->startup_id = sn_id;
+
+        /* It is OK to call unconditionally as it has a custom test
+         * to check whether starting a transient unit can work. */
+        gsm_util_start_systemd_scope (g_app_info_get_id (appinfo), pid, NULL);
 }
 
 #ifdef ENABLE_SYSTEMD_JOURNAL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]