summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-14 21:40:38 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-14 21:41:41 +0100
commit1ca04b87979b2add53ebb8a7fdf13c34fb6c2743 (patch)
treeeddd94f1b3e59a5fae8d5779cdcde8b47ec36f05
parentaca26b52200a4666c9f80a942150a90004130010 (diff)
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
-rw-r--r--src/login/logind-dbus.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 77a06f2ce..d64debe51 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -976,15 +976,18 @@ static int have_multiple_sessions(
Session *session;
Iterator i;
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;
}
static int send_start_unit(DBusConnection *connection, const char *unit_name, DBusError *error) {