From: Lennart Poettering Date: Mon, 14 Jan 2013 20:40:38 +0000 (+0100) Subject: logind: ignore non-tty/non-x11 session when checking if there are other sessions... X-Git-Tag: v198~550 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=1ca04b87979b2add53ebb8a7fdf13c34fb6c2743 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 --- 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 @@ -979,9 +979,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;