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

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