You are not logged in.

#1 2012-08-16 10:02:38

xinit
Member
Registered: 2011-11-12
Posts: 23

[solved] systemd - x server starts at tty2

I have replaced initscripts by udev and limited the number of login shells to spawn to 3

[Login]
NAutoVTs=3

I start my openbox-session via xinit.
But X starts at tty2 and blocks one of the login shells.

WIth initscripts it starts at tty4... and i can access the login shell at tty2

How can i set that the Xserver doesnt start at a tty where a login shell already started?

// edit:
if i log out of the openbox session and start the xserver again... it starts on tty4
seems like it spawns before login shell 2 and 3.....

Last edited by xinit (2012-08-16 15:16:46)

Offline

#2 2012-08-16 10:17:11

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [solved] systemd - x server starts at tty2

Systemd starts tty ondemand. So when you login first time, you only have tty1. So obviously, xserver starts on tty(1+1).
I don't know if there's a way to make x start on another tty (may be tty7, as it always did, at least for me, with 6 shells), i'll follow this thread, waiting for someone who knows how to achieve that! wink

Offline

#3 2012-08-16 10:59:41

xinit
Member
Registered: 2011-11-12
Posts: 23

Re: [solved] systemd - x server starts at tty2

you can pass vtXX as argument to start X on a given tty (here tty4)

#
# ~/.bash_profile
#
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
    if ! [ -e /tmp/.X11-unix/X0 ]; then
        exec nohup xinit openbox -- vt4 > .xlog & vlock
    else
        echo "X server 0 is already running."
    fi                                                                                    
fi
#
# ~/.xinitrc
#
numlockx &
case $1 in
    gnome)      exec ck-launch-session gnome-session;;
    openbox)    exec ck-launch-session dbus-launch openbox-session;;
esac

But this always starts X at tty4... and not just after the last login shell.

Last edited by xinit (2012-08-16 11:00:21)

Offline

#4 2012-08-16 11:28:58

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [solved] systemd - x server starts at tty2

Well, as far as i know, the easiest method is to spawn 6 tty (or 3 in your case) during bootup, just like /etc/inittab did. In this way, x will start on tty7 (4) .

Last edited by nierro (2012-08-16 11:29:10)

Offline

#5 2012-08-16 11:29:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: [solved] systemd - x server starts at tty2

I had the same question.  See this thread for the answer.

Last edited by Trilby (2012-08-16 11:31:19)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2012-08-16 15:16:29

xinit
Member
Registered: 2011-11-12
Posts: 23

Re: [solved] systemd - x server starts at tty2

thanks for the answers

just to summarize:

by default just one login shell spawns - if you start a xserver it uses the next free tty (tty2).
logind.conf (NAutoVTs) defines the number of login shells on demand, which start when you try to access them.
otherwise if you spawn several login shells at startup via getty@tty1.service ... getty@tty6.service the xserver starts at tty7 and the login shells are running in the background.

to force the xserver to start on a specific tty you can add the option vtX, where X defines the number tongue

Offline

Board footer

Powered by FluxBB