[systemd-devel] Bug in systemd? Running X without a display manager

Dave Reisner d at falconindy.com
Mon Aug 27 08:07:53 PDT 2012


On Mon, Aug 27, 2012 at 10:32:43AM -0400, Alan Stern wrote:
> On Sun, 26 Aug 2012, Dave Reisner wrote:
> 
> > On Fri, Aug 24, 2012 at 12:17:08PM -0400, Alan Stern wrote:
> > > I need some help with a problem.
> > > 
> > > I'm currently using Fedora 16, but without a display manager.  I log
> > > into a text-mode VT (usually tty1) and run startx manually.  The
> > > display uses tty7 and works fine.
> > > 
> > > But systemd isn't aware of it, or at least, isn't aware that my login 
> > > session now owns tty7.  For example, the devices labelled with the 
> > > "uaccess" tag have their ACLs adjusted so that I can't use them in the 
> > > graphical environment.  (When I switch back to a text-mode VT they work 
> > > fine.)
> > > 
> > > I'm not sure who to blame for this: systemd, dbus, or myself.  Still,
> > > it seems like this _ought_ to work okay.
> > > 
> > > Can anybody help?
> > > 
> > > Alan Stern
> > > 
> > 
> > You'll need to start X on the same VT that you logged in on. If it's
> > tty1, then:
> > 
> > startx -- vt01
> 
> That's a reasonable workaround, but it's not a real fix.

Why isn't it a real fix? It's simply different semantics from
consolekit. If you want this done automatically, it's trivial to write
your own ~/.xserverrc which does the VT detection and passes it to X as
an argument:

https://gist.github.com/3489325

> Fedora 16 uses ConsoleKit, and testing shows that ConsoleKit is aware 
> of both the test-mode and X session whereas systemd isn't:

That's unfortunate. I doubt anyone on this list cares about CK in any
real way. logind is the "way forward".

> [stern at iolanthe ~]$ ck-list-sessions
> Session1:
>         unix-user = '2102'
>         realname = 'Alan Stern'
>         seat = 'Seat1'
>         session-type = ''
>         active = FALSE
>         x11-display = ''
>         x11-display-device = ''
>         display-device = '/dev/tty1'
>         remote-host-name = ''
>         is-local = TRUE
>         on-since = '2012-08-27T13:52:33.245828Z'
>         login-session-id = '1'
>         idle-since-hint = '2012-08-27T13:53:04.012294Z'
> Session2:
>         unix-user = '2102'
>         realname = 'Alan Stern'
>         seat = 'Seat1'
>         session-type = ''
>         active = TRUE
>         x11-display = ':0'
>         x11-display-device = '/dev/tty7'
>         display-device = ''
>         remote-host-name = ''
>         is-local = TRUE
>         on-since = '2012-08-27T13:52:37.086051Z'
>         login-session-id = '1'

Presumably, this only works because you launch X with ck-launch-session
and pam_ck_connector somewhere in your PAM login stack. I don't know
exactly how CK works, but it's my understanding that logind requires a
process running as root to register a new session (on the new tty) if it
is to be authenticated for at_console privileges.

> [stern at iolanthe ~]$ systemd-loginctl list-sessions
>    SESSION        UID USER             SEAT            
>          1       2102 stern            seat0           
> 
> 1 sessions listed.
> [stern at iolanthe ~]$ systemd-loginctl show-session 1
> Id=1
> Name=stern
> Timestamp=Mon, 27 Aug 2012 09:52:32 -0400
> TimestampMonotonic=100394935
> ControlGroupPath=/user/stern/1
> VTNr=1
> TTY=tty1
> Remote=no
> Service=login
> Leader=992
> Audit=1
> Type=tty
> Active=no
> KillProcesses=no
> IdleHint=yes
> IdleSinceHint=300000000
> IdleSinceHintMonotonic=0
> 
> 
> Evidently information is getting sent to (or by) ConsoleKit but not to
> systemd, or else the information does get sent to systemd and systemd
> ignores it.  Either way, this is a bug (although I can't tell where).

I can't speak for Lennart and Kay, but I'm pretty sure they'll tell you
that this is working as intended.

> Now perhaps ConsoleKit is old hat and nobody cares about it any more.  
> I haven't tried doing this under a more recent version of Fedora.  Is 
> there any reason to think it would work any better?

Well, the startx behavior I showed you will continue to work. I'd
suspect that a newer version of Fedora might not have consolekit at all.

> Alan Stern
> 


More information about the systemd-devel mailing list