Comment 2 for bug 687296

Revision history for this message
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).