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

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