Comment 11 for bug 1673215

Revision history for this message
Michael Terry (mterry) wrote :

OK, more research. This looks to be a mismatch between what logind expects lightdm to do and what we actually do.

Mir sessions started by lightdm all use the same VT number (they all live on the VT owned by unity-system-compositor.

But logind does not allow two user sessions to be on the same VT. (It does allow greeter and user sessions to share one, which is why we didn't notice this bug when using unity8-greeter logging into a unity8 session.) The relevant logind check is listed below [1].

One fix would be to allow type=mir sessions to share a VT. But I'd like input from Robert Ancell before moving on that. It's possible lightdm should be doing something else or that we don't actually want to break the assumption in systemd that each session has its own VT.

[1]
        /*
         * Old gdm and lightdm start the user-session on the same VT as
         * the greeter session. But they destroy the greeter session
         * after the user-session and want the user-session to take
         * over the VT. We need to support this for
         * backwards-compatibility, so make sure we allow new sessions
         * on a VT that a greeter is running on. Furthermore, to allow
         * re-logins, we have to allow a greeter to take over a used VT for
         * the exact same reasons.
         */
        if (c != SESSION_GREETER &&
            vtnr > 0 &&
            vtnr < m->seat0->position_count &&
            m->seat0->positions[vtnr] &&
            m->seat0->positions[vtnr]->class != SESSION_GREETER)
                return sd_bus_error_setf(error, BUS_ERROR_SESSION_BUSY, "Already occupied by a session");