[comp.windows.open-look] Launching remote X applications

paulo@ohmeda.com (Paul Ourada) (06/19/91)

Hi - I'm relatively new to the world of X, and I was wondering if someone 
could help me with a problem.  I am working on an IPC and I would like to be
able to launch, say the stock XVIEW texteditor, on a SPARCstation 2 and have 
the display show up on my IPC.  A friend of mine told me to rlogin to the SS2,
change the DISPLAY env. variable to aspen:0.0, and then launch the app in the 
background.  I tried this, but got a library error that complained that it
couldn't find lib.so.3( or some such library. i don't 'zactly recall... ).

Any ideas?

Thanks-in-advance,

Paul E. Ourada
Software Engineer
Ohmeda Monitoring Systems
paulo@ohmeda.com

paulo@ohmeda.com (Paul Ourada) (06/24/91)

Hi again.  I'd like to thank everyone for their suggestions and tips wrt 
launching remote X applications.  It seems, that my problem was specifically
the LD_LIBRARY_PATH environment variable.  I will cover the entire procedure
below for those other newcomers like myself.

setenv OPENWINHOME /usr/openwin
setenv FONTPATH $OPENWINHOME/lib/fonts
setenv HELPPATH $OPENWINHOME/lib/help
setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
setenv MANPATH $OPENWINHOME/share/man:/usr/man

when you rlogin or rsh, set the DISPLAY env var thusly:

setenv DISPLAY "you host name":0.0

Scott Brim <swb@MITCHELL.CIT.CORNELL.EDU> gave me the following script which he calls rx:

---------------------------------
#!/bin/sh -

host=$1 ; shift

case $DISPLAY in
:0|:0.0|unix:0|unix:0.0) xhost $host >/dev/null ; DISPLAY=`hostname`:0
esac

rsh -n $host "sh -c 'DISPLAY=$DISPLAY $@ >/dev/null 2>&1&'"

----------------------------------

I haven't tried it yet, so I can't tell you if it works, but Scott seems like a 
nice guy...:-)  He says that his officemate has a more complicated one.


Again, thanks to all that have replied.  It has been an uplifting experience.

Paul E. Ourada
Software Engineer
Ohmeda Monitoring Systems
paulo@ohmeda.com

rdong@MSRI.ORG (Rui - Tao Dong) (06/25/91)

In article <1991Jun24.161957.648@ohmeda.com> paulo@ohmeda.com (Paul Ourada) writes:
>Hi again.  I'd like to thank everyone for their suggestions and tips wrt 
>launching remote X applications.  It seems, that my problem was specifically
>the LD_LIBRARY_PATH environment variable.  I will cover the entire procedure
>below for those other newcomers like myself.
>
>setenv OPENWINHOME /usr/openwin
>setenv FONTPATH $OPENWINHOME/lib/fonts
>setenv HELPPATH $OPENWINHOME/lib/help
>setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
>setenv MANPATH $OPENWINHOME/share/man:/usr/man
>
>when you rlogin or rsh, set the DISPLAY env var thusly:
>
>setenv DISPLAY "you host name":0.0
>
>Scott Brim <swb@MITCHELL.CIT.CORNELL.EDU> gave me the following script which he calls rx:
>
>---------------------------------
>#!/bin/sh -
>
>host=$1 ; shift
>
>case $DISPLAY in
>:0|:0.0|unix:0|unix:0.0) xhost $host >/dev/null ; DISPLAY=`hostname`:0
>esac
>
>rsh -n $host "sh -c 'DISPLAY=$DISPLAY $@ >/dev/null 2>&1&'"
>
>----------------------------------
>
>I haven't tried it yet, so I can't tell you if it works, but Scott seems like a 
>nice guy...:-)  He says that his officemate has a more complicated one.
>
>
>Again, thanks to all that have replied.  It has been an uplifting experience.
>
>Paul E. Ourada
>Software Engineer
>Ohmeda Monitoring Systems
>paulo@ohmeda.com
>
>


	I wrote a shellscript, which I call xrlogin. It will set DISPLAY
for plain X and NEWSSERVER as well for xnews. You need to put the following
on top of your .login.

-------------------------------------------------

set switch=($term)

switch($#switch)
	case 3:
		setenv NEWSSERVER $switch[3]
	case 2:
		setenv DISPLAY $switch[2]
	default:	
		setenv TERM $switch[1]
endsw
unset switch

setenv OPENWINHOME /usr/openwin

if ( $?NEWSSERVER == 1 ) then

	setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
	setenv PATH .:$HOME/bin:/usr/local/bin:/usr/ucb:$OPENWINHOME/bin:$OPENWINHOME/bin/xview:$OPENWINHOME/demo:/usr/bin/X11:/usr/bin:/bin
	setenv MANPATH $OPENWINHOME/man:/usr/local/man:/usr/man
	eval `svenv -env -csh`
else

	setenv PATH .:$HOME/bin:/usr/local/bin:/usr/ucb:/usr/bin/X11:/usr/bin:/bin:$OPENWINHOME/bin:$OPENWINHOME/bin/xview:$OPENWINHOME/demo
	setenv MANPATH /usr/local/man:/usr/man:$OPENWINHOME/man

endif

-------------------------------------------------

	The following is the script for xrlogin.
-------------------------------------------------
#!/bin/sh

case "X$DISPLAY" in
Xunix:*)
  : ${HOSTNAME=`hostname`}
  DISPLAY=`echo "$DISPLAY" | sed -e "s/^unix:/${HOSTNAME}:/"`
  ;;
X:*)
  : ${HOSTNAME=`hostname`}
  DISPLAY="$HOSTNAME$DISPLAY"
  ;;
esac

TERM=${TERM}${DISPLAY:+" $DISPLAY"}${NEWSSERVER:+" $NEWSSERVER"}; export TERM

exec rlogin "$@"

--------------------------------------------------------------

	Hope this helps.

Regards,

-------------------------------------------------------------------------
	Rui - Tao  Dong         |       (415) 237 - 7628 (H)
	Math Sci Research Inst	|       (415) 643 - 6048 (O)
	1000 Centennial Drive	|       (415) 643 - 5348 (Fax)
	Berkeley, CA 94720	|	rdong@borel.msri.org

rdong@borel.msri.org (Rui - Tao Dong) (06/25/91)

In article <1991Jun24.161957.648@ohmeda.com> paulo@ohmeda.com (Paul Ourada) writes:
>Hi again.  I'd like to thank everyone for their suggestions and tips wrt 
>launching remote X applications.  It seems, that my problem was specifically
>the LD_LIBRARY_PATH environment variable.  I will cover the entire procedure
>below for those other newcomers like myself.
>
>setenv OPENWINHOME /usr/openwin
>setenv FONTPATH $OPENWINHOME/lib/fonts
>setenv HELPPATH $OPENWINHOME/lib/help
>setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
>setenv MANPATH $OPENWINHOME/share/man:/usr/man
>
>when you rlogin or rsh, set the DISPLAY env var thusly:
>
>setenv DISPLAY "you host name":0.0
>
>Scott Brim <swb@MITCHELL.CIT.CORNELL.EDU> gave me the following script which he calls rx:
>
>---------------------------------
>#!/bin/sh -
>
>host=$1 ; shift
>
>case $DISPLAY in
>:0|:0.0|unix:0|unix:0.0) xhost $host >/dev/null ; DISPLAY=`hostname`:0
>esac
>
>rsh -n $host "sh -c 'DISPLAY=$DISPLAY $@ >/dev/null 2>&1&'"
>
>----------------------------------
>
>I haven't tried it yet, so I can't tell you if it works, but Scott seems like a 
>nice guy...:-)  He says that his officemate has a more complicated one.
>
>
>Again, thanks to all that have replied.  It has been an uplifting experience.
>
>Paul E. Ourada
>Software Engineer
>Ohmeda Monitoring Systems
>paulo@ohmeda.com
>
>


	I wrote a shellscript, which I call xrlogin. It will set DISPLAY
for plain X and NEWSSERVER as well for xnews. You need to put the following
on top of your .login.

-------------------------------------------------

set switch=($term)

switch($#switch)
	case 3:
		setenv NEWSSERVER $switch[3]
	case 2:
		setenv DISPLAY $switch[2]
	default:	
		setenv TERM $switch[1]
endsw
unset switch

setenv OPENWINHOME /usr/openwin

if ( $?NEWSSERVER == 1 ) then

	setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
	setenv PATH .:$HOME/bin:/usr/local/bin:/usr/ucb:$OPENWINHOME/bin:$OPENWINHOME/bin/xview:$OPENWINHOME/demo:/usr/bin/X11:/usr/bin:/bin
	setenv MANPATH $OPENWINHOME/man:/usr/local/man:/usr/man
	eval `svenv -env -csh`
else

	setenv PATH .:$HOME/bin:/usr/local/bin:/usr/ucb:/usr/bin/X11:/usr/bin:/bin:$OPENWINHOME/bin:$OPENWINHOME/bin/xview:$OPENWINHOME/demo
	setenv MANPATH /usr/local/man:/usr/man:$OPENWINHOME/man

endif

-------------------------------------------------

	The following is the script for xrlogin.
-------------------------------------------------
#!/bin/sh

case "X$DISPLAY" in
Xunix:*)
  : ${HOSTNAME=`hostname`}
  DISPLAY=`echo "$DISPLAY" | sed -e "s/^unix:/${HOSTNAME}:/"`
  ;;
X:*)
  : ${HOSTNAME=`hostname`}
  DISPLAY="$HOSTNAME$DISPLAY"
  ;;
esac

TERM=${TERM}${DISPLAY:+" $DISPLAY"}${NEWSSERVER:+" $NEWSSERVER"}; export TERM

exec rlogin "$@"

--------------------------------------------------------------

	Hope this helps.

Regards,

-------------------------------------------------------------------------
	Rui - Tao  Dong         |       (415) 237 - 7628 (H)
	Math Sci Research Inst	|       (415) 643 - 6048 (O)
	1000 Centennial Drive	|       (415) 643 - 5348 (Fax)
	Berkeley, CA 94720	|	rdong@borel.msri.org




--

Regards,

-------------------------------------------------------------------------

Michael.Oconnor@West.Sun.COM (Michael O'Connor - SE Sacramento) (06/25/91)

   []From owner-openlook@uunet.uu.net Mon Jun 24 13:32:17 1991
   []Return-Path: <owner-openlook@uunet.uu.net>
   []To: openlook@uunet.UU.NET
   []Path: unify!csusac!ucdavis!ucbvax!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!csn!otis!paulo
   []From: paulo@ohmeda.com (Paul Ourada)
   []Newsgroups: comp.windows.open-look
   []Subject: Launching remote X applications
   []Date: 24 Jun 91 16:19:57 GMT
   []Organization: Ohmeda Monitoring Systems
   []Lines: 40
   []Status: RO
   []
   []Hi again.  I'd like to thank everyone for their suggestions and tips wrt 
   []launching remote X applications.  It seems, that my problem was specifically
   []the LD_LIBRARY_PATH environment variable.  I will cover the entire procedure
   []below for those other newcomers like myself.
   []
   []setenv OPENWINHOME /usr/openwin
   []setenv FONTPATH $OPENWINHOME/lib/fonts
   []setenv HELPPATH $OPENWINHOME/lib/help
   []setenv LD_LIBRARY_PATH $OPENWINHOME/lib:/usr/lib
   []setenv MANPATH $OPENWINHOME/share/man:/usr/man
   []
   []when you rlogin or rsh, set the DISPLAY env var thusly:
   []
   []setenv DISPLAY "you host name":0.0
   []
   []Scott Brim <swb@MITCHELL.CIT.CORNELL.EDU> gave me the following script which he calls rx:
   []
   []---------------------------------
   []#!/bin/sh -
   []
   []host=$1 ; shift
   []
   []case $DISPLAY in
   []:0|:0.0|unix:0|unix:0.0) xhost $host >/dev/null ; DISPLAY=`hostname`:0
   []esac
   []
   []rsh -n $host "sh -c 'DISPLAY=$DISPLAY $@ >/dev/null 2>&1&'"
   []
   []----------------------------------
   []
   []I haven't tried it yet, so I can't tell you if it works, but Scott seems like a 
   []nice guy...:-)  He says that his officemate has a more complicated one.
   []
   []
   []Again, thanks to all that have replied.  It has been an uplifting experience.
   []
   []Paul E. Ourada
   []Software Engineer
   []Ohmeda Monitoring Systems
   []paulo@ohmeda.com
   []

Another interesting approach is to use the on(1C) command which uses
rexd(8c) to execute the process on the remote system. On executes
the command remotely but unlike rsh, it maintains the users current
environment and even performs NFS mounts if necessary. On may not
be implemented on all vendors systems however.

You still have to set the DISPLAY variable however as by default it
is set to :0 instead of `hostname`:0.

--michael

sarima@tdatirv.UUCP (Stanley Friesen) (06/25/91)

In article <w6cs2z5@openlook.Unify.Com> Michael.Oconnor@West.Sun.COM (Michael O'Connor - SE Sacramento) writes:
>Another interesting approach is to use the on(1C) command which uses
>rexd(8c) to execute the process on the remote system. On executes
>the command remotely but unlike rsh, it maintains the users current
>environment and even performs NFS mounts if necessary. On may not
>be implemented on all vendors systems however.

Yeah, wouldn't that be nice.  But it is not always available.

Our management here says that on(1C) is a serious security risk and
refuses to activate the necessary demon.

So I am stuck with a shell script that sets up everything on the far end.
-- 
---------------
uunet!tdatirv!sarima				(Stanley Friesen)