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

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