I solved it.  It turns out I need to somehow supply the DISPLAY environment
to the shell which executes the application on the dumb client.
Most apps don't have a "-display" option.


ashley@ishi:~ >rsh alban
Password: 

ashley@alban:~ >echo $DISPLAY

ashley@alban:~ >/usr/bin/tuxracer

*** tuxracer error: Couldn't initialize SDL: No available video device

ashley@alban:~ >export DISPLAY=:0.0
ashley@alban:~ >echo $DISPLAY      
:0.0
ashley@alban:~ >/usr/bin/tuxracer  

joy



I wrote a pair of scripts to accomplish this:
/usr/local/bin/ltsp_runlocal                    # runs on the server
                                                # calls launch_localapp
/opt/ltsp/i386/usr/local/bin/launch_localapp    # runs on the client

Theses allow me to run local apps directly from my terminal shell:
ashley@ishi:~ >ltsp_runlocal tuxracer



I also wrote a script for easy installation of local apps into the 
ltsp export tree:
/usr/local/sbin/ltsp_makelocalapp


I would like to contribute these to the LTSP documentation.  Who do I
talk to?




#!/bin/bash
#set -x

# ltsp_runlocal
# ashley gould [EMAIL PROTECTED]
# Fri Oct 18 01:03:35 PDT 2002

# for use with Linux Terminal Server Project
# runs an application on the client host
#
# calls the launcher wrapper on the client host and passes it the DISPLAY
# environment variable and the command line
#
# I install this to /usr/local/bin on the server


USAGE="usage: ltsp_runlocal command_name [parameters]"


# application launch wrapper run on client
# path is relative to client's root filesystem
LAUNCHER=/usr/local/bin/launch_localapp 

LTSP_DIR=/opt/ltsp/i386
RSH=/usr/bin/rsh



# get the command name from input, check if it's an executable 
if [ -z $1 ]; then
    echo $USAGE
    exit 1
elif [ ! -x "$(/usr/bin/which $1 2> /dev/null)" ]; then
    echo $USAGE
    echo $1 is not a valid executable
    exit 1
else
    COMMAND=$(/usr/bin/which $1 2> /dev/null)
fi

if [ ! -x $LTSP_DIR$COMMAND ]; then
    echo $COMMAND not installed in $LTSP_DIR
    exit 1
fi


# get the hostname of the client running this display
HOST=$(echo $DISPLAY | awk -F: '{ print $1 }')

# ${*#$1} this ugly stuff gives us any parameters
PARAMETERS=${*#$1}

# call the launcher on client
#echo $RSH $HOST $LAUNCHER $DISPLAY $COMMAND $PARAMETERS
$RSH $HOST $LAUNCHER $DISPLAY $COMMAND $PARAMETERS

exit 0





#!/bin/bash

# launch_localapp
# ashley gould [EMAIL PROTECTED]
# Fri Oct 18 00:51:31 PDT 2002

# for use with Linux Terminal Server Project
#
# This is the wrapper script called by ltsp_runlocal
# for launching applications that run on the client.  It first sets
# the DISPLAY environment variable passed to it by ltsp_runlocal
# and then execs the application.
#
# I install it on the server at:
# /opt/ltsp/i386/usr/local/bin/launch_localapp
#
# Usage: 
# ltsp_runlocal application [parameters]                # runs on server
# launch_localapp displayname application [parameters]  # runs on client


# get DISPLAY
export DISPLAY=$1

# launch app
# ${*#$1}
# this ugly stuff gives us the command and any parameters

#echo launch_localapp:  $DISPLAY, ${*#$1}
exec ${*#$1}







#!/bin/bash
#set -x

# ltsp_makelocalapp
# ashley gould [EMAIL PROTECTED]
# Mon Oct 14 19:11:31 PDT 2002


# for use with Linux Terminal Server Project
#
# This script will copy the given executables and any needed libraries
# into the ltsp export directory.  If new libs were copied over, then it
# runs ldconfig using the ltsp export tree as root.
#
# In addition, you should check if the application has its own data files
# with rpm and copy those over by hand:
#
# ishi:~ # rpm -qf `which tuxracer`
# tuxracer-0.61-141
# ishi:~ # rpm -ql tuxracer
# /usr/bin/tuxracer
# blah
# blah
# /usr/share/tuxracer
# blah
# blah
# ishi:~ # cp -av /usr/share/tuxracer /opt/ltsp/i386/usr/share/




if [ "$UID" != 0 ]; then
  echo "You must be root to run this."
  exit 1
fi


USAGE="usage: ltsp_makelocalapp command_name [command_name ...]"
LTSP_DIR=/opt/ltsp/i386
NEWLIB="NO"
declare -a COPY_ERROR
ERR_NUM=0


if [ $# -lt 1 ]; then
    echo $USAGE
    exit 1
fi


for i in $@; do

    # get the program name from the command line
    echo;echo
    echo $i
    if [ ! -x "$(/usr/bin/which $i 2> /dev/null)" ]; then
        echo $USAGE
        echo $i is not a valid executable
        continue
    else
        FILE=$(/usr/bin/which $i 2> /dev/null)
    fi 
    echo
    
    # copy the program
    if [ -x "$LTSP_DIR$FILE" ]; then 
        echo $FILE already an executible in $LTSP_DIR
    else
        echo "copying $FILE to $LTSP_DIR$FILE"
        /bin/cp -a $FILE "$LTSP_DIR$FILE" || {
            COPY_ERROR[$ERR_NUM]=$FILE
            let "ERR_NUM = $ERR_NUM + 1"
        }
    fi 
    echo
    
    # copy required libs
    echo checking for required libs:
    LIBS=$(/usr/bin/ldd $FILE 2> /dev/null |grep -v "not a "| awk '{print$ 3}')
    for lib in $LIBS; do
        if [ -f "$LTSP_DIR$lib" -o -L "$LTSP_DIR$lib" ]; then
            echo "        $lib already installed"
        else
            echo "copying $lib   =>   $LTSP_DIR$lib"
            /bin/cp -p $lib "$LTSP_DIR$lib"
            if [ $? -ne 0 ]; then 
                COPY_ERROR[$ERR_NUM]=$lib
                let "ERR_NUM = $ERR_NUM + 1"
            else
                [ $NEWLIB == "NO" ] && NEWLIB="YES"
            fi
        fi
    done
    echo

done


# run ldconfig if new libraries were copied into the ltsp tree
if [ $NEWLIB == "YES" ]; then
    echo;echo
    echo running ldconfig:
    /sbin/ldconfig -r $LTSP_DIR -v
fi

# report file copying errors
if [ $ERR_NUM -gt 0 ]; then
    echo
    echo The following files could not be copied into the ltsp export tree.
    echo ${COPY_ERROR[*]}
    echo
    echo Check the above output for /bin/cp errors.
    echo Probalbly $LTSP_DIR does not have the necessary directory
    echo structure to accomodate the new files.  You may need to create
    echo these directories by hand and rerun this script.
    echo;echo
fi







exit 0



On Thu, Oct 17, 2002 at 01:04:41PM -0700, ashley wrote:
> 
> Hi Randall,
> 
> I run sh /tmp/start_ws from runlevel 3.  I'm still testing.
> 
> tuxracer seems to be the only one of these that wants a framebuffer.  Do you
> know off hand what are the kernel configs for framebuffering?  (You do don't
> you) I'll try a new kernel.
> 
> I will still need to create the /dev/fb0 device though.  How is this done in
> ltsp?  And what is SDL?
> 
> But I think bzflag and tuxkart errors are not related to fb device.  Looks to
> me like an auth problem.  I don't know.  Perhaps I'll try some X apps that
> don't want DRI and see if there's a difference
> 
> 
> 
> On Thu, Oct 17, 2002 at 12:38:30PM -0700, Randall Craig wrote:
> > Are you running these aps from a frame buffer or in xwindows?
> > >         RUNLEVEL           = 3
> > > 
> > > ashley@alban:~ >strace tuxracer
> > > .
> > > .
> > > .
> > > open("/dev/fb0", O_RDWR)                = -1 ENOENT (No such file or directory)
> > > write(2, "*** tuxracer error: ", 20*** tuxracer error: )    = 20
> > > write(2, "Couldn\'t initialize SDL: No avai"..., 50Couldn't initialize SDL: No 
>available video device) = 50
> > > write(2, "\n", 1
> > > )                       = 1
> > > _exit(1)                                = ?
> > 
> > It looks to be like you are doing things from a frame buffer, which
> > may not even function with the Ltsp kernel.
> > 
> > 
> > -- randall. 
> 
> -- 
> 
> -ashley
> 
>       One of these days I'm going to completely organize my life.
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: viaVerio will pay you up to
> $1,000 for every account that you consolidate with us.
> http://ad.doubleclick.net/clk;4749864;7604308;v?
> http://www.viaverio.com/consolidator/osdn.cfm
> _____________________________________________________________________
> Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
>       https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
> For additional LTSP help,   try #ltsp channel on irc.openprojects.net

-- 

-ashley

        One of these days I'm going to completely organize my life.


Ashley Gould                                    510.482.0525
3020 Kansas St.                                 [EMAIL PROTECTED]
Oakland, CA 94602


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.openprojects.net

Reply via email to