[SunHELP] xhost (cont.)

Sheldon T. Hall shel at cmhcsys.com
Thu Jan 16 12:47:39 CST 2003


"Markham, Richard" <RMarkham at hafeleamericas.com> said ...

> previously I posted about xhost not returning back to command line after
> execution with or without parameters.  I tried from the console and had no
> problem.  At the time I was in ssh which is where I do most
administration.
> I've found that after a reboot that the xhost entries are reset.  Upon
> trying to automate the xhost entries upon boot within an init script I
find
> that xhost doesn't make then entries nor does it produce any output.
>
> example:
> ~
> #! /bin/sh
>   xhost server1 server2 server2
> ~
> I threw in a DISPLAY=server:0.0; export DISPLAY on the first line and
still
> no go.  I still haven't pinpointed what I need to do for this situation
but
> the end result obviously is to always have xhost entries without manually
> adding them each reboot.

Is it possible that you're running this on the wrong machine?  Remember than
in X terminology, the server is the box you're sitting in front of, and the
client is the remote box you're connecting to.  This is backwards from the
way this terminology is used in other places.

Ergo, if you have a hulking huge Sun machine in some machineroom named
"vast" and a machine on your desk named "tiny", in X terms, "tiny" is the
_server_ and "vast" is the client.

You run xhost on the _X_server_, i.e. tiny, your desktop, not on vast.

I run xhost in a script on my desktop machine all the time, so I know it
works.  Of course, I'm on the "console" of my desktop machine; it's a
laptop.  I have scripts on my laptop to connect me to various host machines
(i.e. X clients) and display stuff on my laptop; the scripts generally look
like this:

# Is it already on the list?  If not, add it.
xhost | grep "some.machine" > /dev/null || xhost rtfm
# Now that it can display here, connect.
rsh some.machine /usr/openwin/bin/xterm -display 192.168.0.101:0.0 -ls &

-Shel


More information about the SunHELP mailing list