forked from pool/systemd
3283fdeb6b
add: 1026-re-add-persistent-net.patch - rebase all patches, ensure that they apply properly. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=357
31 lines
1.3 KiB
Diff
31 lines
1.3 KiB
Diff
From 1ca04b87979b2add53ebb8a7fdf13c34fb6c2743 Mon Sep 17 00:00:00 2001
|
|
From: Lennart Poettering <lennart@poettering.net>
|
|
Date: Mon, 14 Jan 2013 21:40:38 +0100
|
|
Subject: [PATCH] logind: ignore non-tty/non-x11 session when checking if
|
|
there are other sessions before shutting down
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=890827
|
|
---
|
|
src/login/logind-dbus.c | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
Index: systemd-195/src/login/logind-dbus.c
|
|
===================================================================
|
|
--- systemd-195.orig/src/login/logind-dbus.c
|
|
+++ systemd-195/src/login/logind-dbus.c
|
|
@@ -971,9 +971,12 @@ static int have_multiple_sessions(
|
|
|
|
assert(m);
|
|
|
|
- /* Check for other users' sessions. Greeter sessions do not count. */
|
|
+ /* Check for other users' sessions. Greeter sessions do not
|
|
+ * count, and non-login sessions do not count either. */
|
|
HASHMAP_FOREACH(session, m->sessions, i)
|
|
- if (session->class == SESSION_USER && session->user->uid != uid)
|
|
+ if (session->class == SESSION_USER &&
|
|
+ (session->type == SESSION_TTY || session->type == SESSION_X11) &&
|
|
+ session->user->uid != uid)
|
|
return true;
|
|
|
|
return false;
|