Linux Terminal Server Project

LDM screen not started by default

Reported by Wim Muskee on 2010-12-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP
Low
Unassigned

Bug Description

On Gentoo by default, the client stays on vt1 after startup. Only after switching to vt7 (ALT F7), the ldm login screen starts up and a user can login normally.

One workaround is the specify SCREEN_01 = ldm in the lts.conf

Another by Horst Prote (http://bugs.gentoo.org/show_bug.cgi?id=177580#c120) is:

To determine the initial active screen after boot I added
        START_SCREEN = 07
to my lts.conf and changed /usr/share/ltsp/screen_session to:
  while [ ${SCREEN_NUM} -ne ${START_SCREEN} ] && \
        [ $(fgconsole) -ne ${SCREEN_NUM} ]; do
      sleep 2
  done

On Wed, Dec 08, 2010 at 12:33:28PM -0000, Wim Muskee wrote:
> On Gentoo by default, the client stays on vt1 after startup. Only after
> switching to vt7 (ALT F7), the ldm login screen starts up and a user can
> login normally.

i think gentoo uses it's own init script (or something sort of like an init
script), but there's code to handle the switching in
ltsp-trunk/client/initscripts/ltsp-core:

        if [ -z "${SCREEN_DEFAULT}" ]; then
            for screen in 01 02 03 04 05 06 07 08 09 10 11 12; do
                eval num=\$SCREEN_$screen
                [ -n "$num" ] && SCREEN_DEFAULT=$screen
            done
        fi

        # Find current tty, and if it is not the same as SCREEN_DEFAULT, chvt
        if [ -n "${SCREEN_DEFAULT}" ] && [ $(fgconsole) -ne ${SCREEN_DEFAULT} ]; then
            chvt ${SCREEN_DEFAULT}
        fi

you'll need to add similar code to one of the scripts in
ltsp-trunk/client/initscripts/Gentoo/

if possible, make it into a function that can be included in
ltsp-trunk/client/initscripts/ltsp-init-common, an then used by multiple
distros.

live well,
  vagrant

Wim Muskee (wimmuskee) wrote :

Okay, that worked, i've created a start_screen() in ltsp-init-common, which can be called from the Gentoo initscript. Compared to the code in ltsp-core, I'm not iterating the 01-12 to actually start $SCREEN_DEFAULT, we know it's value already.

start_screen() {
        if [ -z "${SCREEN_DEFAULT}" ]; then
                for screen in 01 02 03 04 05 06 07 08 09 10 11 12; do
                        eval num=\$SCREEN_$screen
                                if [ -n "$num" ]; then
                                        SCREEN_DEFAULT=$screen
                                fi
                done
        fi

        if [ -n "${SCREEN_DEFAULT}" ] && [ $(fgconsole) -ne ${SCREEN_DEFAULT} ]; then
            chvt ${SCREEN_DEFAULT}
        fi

        start-stop-daemon --start -b --exec /bin/sh /usr/share/ltsp/screen_session -- "$SCREEN_DEFAULT"
}

Although it works, I'm not sure if I can commit it like this in ltsp-init-common, and remove to portion in ltsp-core (and add a start_screen() || true).

On Sun, Dec 12, 2010 at 11:32:06AM -0000, Wim Muskee wrote:
> Okay, that worked, i've created a start_screen() in ltsp-init-common,
> which can be called from the Gentoo initscript. Compared to the code in
> ltsp-core, I'm not iterating the 01-12 to actually start
> $SCREEN_DEFAULT, we know it's value already.

it needs to start all of the defined SCREEN_NN entries, otherwise it breaks
multiple screen scripts; only the screen script that ends up being
SCREEN_DEFAULT will get started. if a user switches to another tty, nothing
will happen.

i just committed to bzr moving the code from ltsp-core to a
start_screen_sessions function in ltsp-init-common. let us know if that doesn't
work for gentoo, or if there are changes other distros would need to make it
work.

live well,
  vagrant

Wim Muskee (wimmuskee) on 2010-12-21
Changed in ltsp:
status: New → Fix Committed
Wim Muskee (wimmuskee) on 2011-03-22
Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers