Blame SOURCES/0001-data-reap-gdm-sessions-on-shutdown.patch

1f0c33
From a4743b9b2b355f84da3904e7da93ec3c7a521895 Mon Sep 17 00:00:00 2001
1f0c33
From: Ray Strode <rstrode@redhat.com>
1f0c33
Date: Fri, 26 Jul 2019 14:06:16 -0400
1f0c33
Subject: [PATCH] data: reap gdm sessions on shutdown
1f0c33
1f0c33
If GDM gets shutdown we should make sure all sessions get shutdown too.
1f0c33
1f0c33
This is a bit of a safety net in case any processes in the session are
1f0c33
lingering after the orderly shutdown.
1f0c33
---
1f0c33
 data/gdm.service.in | 1 +
1f0c33
 1 file changed, 1 insertion(+)
1f0c33
1f0c33
diff --git a/data/gdm.service.in b/data/gdm.service.in
1f0c33
index 17e8a8de..195bd0fd 100644
1f0c33
--- a/data/gdm.service.in
1f0c33
+++ b/data/gdm.service.in
1f0c33
@@ -1,33 +1,34 @@
1f0c33
 [Unit]
1f0c33
 Description=GNOME Display Manager
1f0c33
 
1f0c33
 # replaces the getty
1f0c33
 Conflicts=getty@tty${GDM_INITIAL_VT}.service
1f0c33
 After=getty@tty${GDM_INITIAL_VT}.service
1f0c33
 
1f0c33
 # replaces plymouth-quit since it quits plymouth on its own
1f0c33
 Conflicts=${PLYMOUTH_QUIT_SERVICE}
1f0c33
 After=${PLYMOUTH_QUIT_SERVICE}
1f0c33
 
1f0c33
 # Needs all the dependencies of the services it's replacing
1f0c33
 # pulled from getty@.service and ${PLYMOUTH_QUIT_SERVICE}
1f0c33
 # (except for plymouth-quit-wait.service since it waits until
1f0c33
 # plymouth is quit, which we do)
1f0c33
 After=rc-local.service plymouth-start.service systemd-user-sessions.service
1f0c33
 
1f0c33
 # GDM takes responsibility for stopping plymouth, so if it fails
1f0c33
 # for any reason, make sure plymouth still stops
1f0c33
 OnFailure=plymouth-quit.service
1f0c33
 
1f0c33
 [Service]
1f0c33
 ExecStart=${sbindir}/gdm
1f0c33
+ExecStopPost=-/usr/bin/bash -c 'for f in /run/systemd/sessions/*; do [ -f $f ] && /usr/bin/fgrep -q SERVICE=gdm $f && loginctl terminate-session $(basename $f); done'
1f0c33
 KillMode=mixed
1f0c33
 Restart=always
1f0c33
 IgnoreSIGPIPE=no
1f0c33
 BusName=org.gnome.DisplayManager
1f0c33
 EnvironmentFile=-${LANG_CONFIG_FILE}
1f0c33
 ExecReload=/bin/kill -SIGHUP $MAINPID
1f0c33
 KeyringMode=shared
1f0c33
 
1f0c33
 [Install]
1f0c33
 Alias=display-manager.service
1f0c33
-- 
1f0c33
2.32.0
1f0c33