xhost

  • Follow


export DISPLAY=hostname:0.0
xhost

then hang forever. any idea please?

0
Reply lan.shen (2) 1/23/2006 9:03:16 PM

lan.shen@stpete.org wrote:
> export DISPLAY=hostname:0.0
> xhost
> 
> then hang forever. any idea please?
> 

I suspect hostname cannot be resolved. Try trussing xhost.
I.e.:
$ truss xhost

Then you will see where it hangs.

Tom
0
Reply Thomas 1/23/2006 9:10:48 PM


thanks a lot.
Here is the last line after I run truss
poll(0xFFBFFA00, 1, -1)         (sleeping...)

0
Reply lan 1/23/2006 9:13:29 PM

The whole output is too long to post here. I have a file. If you could
give me your email address, I will send it to you. 

thanks again

0
Reply lan 1/23/2006 9:16:11 PM

lan.shen@stpete.org wrote:
> The whole output is too long to post here. I have a file. If you could
> give me your email address, I will send it to you. 
> 
> thanks again
> 

What does
$ host hostname
say?
0
Reply Thomas 1/23/2006 9:23:45 PM

ksh: host:  not found

I have another box. I found out /usr/sbin/host. but not on this box.

0
Reply lan 1/23/2006 9:32:28 PM

lan.shen@stpete.org wrote:
> ksh: host:  not found
> 
> I have another box. I found out /usr/sbin/host. but not on this box.
> 


$ pkgchk -l -p /usr/sbin/host
NOTE: Couldn't lock the package database.
Pathname: /usr/sbin/host
Type: regular file
Expected mode: 0555
Expected owner: root
Expected group: bin
Expected file size (bytes): 66980
Expected sum(1) of contents: 443
Expected last modification: Nov 04 21:56:39 2005
Referenced by the following packages:
         SUNWbind
Current status: installed

It is part of the SUNWbind package. You can add it to your system with 
pkgadd.
0
Reply Thomas 1/23/2006 9:43:52 PM

Thomas Maier-Komor <maierkom@lpr.e-technik.tu-muenchen.de> wrote in 
news:dr3if7$fjs$2@wsc10.lrz-muenchen.de:

> lan.shen@stpete.org wrote:
>> ksh: host:  not found
>> 
>> I have another box. I found out /usr/sbin/host. but not on this box.
>> 
> 
> 
> $ pkgchk -l -p /usr/sbin/host
> NOTE: Couldn't lock the package database.
> Pathname: /usr/sbin/host
> Type: regular file
> Expected mode: 0555
> Expected owner: root
> Expected group: bin
> Expected file size (bytes): 66980
> Expected sum(1) of contents: 443
> Expected last modification: Nov 04 21:56:39 2005
> Referenced by the following packages:
>          SUNWbind
> Current status: installed
> 
> It is part of the SUNWbind package. You can add it to your system with 
> pkgadd.
> 

Been a while since I have done it but I seem to remember it was:
display=hostname or ip:0.0
export DISPLAY

Like I said, been a while so I may be wrong...
0
Reply Rich 1/23/2006 10:18:37 PM

Thomas Maier-Komor <maierkom@lpr.e-technik.tu-muenchen.de> wrote:
> What does
> $ host hostname
> say?

Or more general (honours /etc/nsswitch.conf):

$ getent hosts <hostname>

-- 
Daniel
0
Reply Daniel 1/23/2006 10:34:49 PM

lan.shen@stpete.org wrote:
> thanks a lot.
> Here is the last line after I run truss
> poll(0xFFBFFA00, 1, -1)         (sleeping...)

I can get exactly the same thing to happen without a problem with the
hostname.  For instance, if I do:

	$ export DISPLAY=:0
	$ xhost

it will hang if I am doing this as a regular user and dtlogin is
running on the X server (i.e. nobody is logged in through dtlogin).

Doing a truss of my xhost reveals that it opens /tmp/.X11-pipe/X0
read-write, then it opens, reads from, and closes $HOME/.Xauthority.
Then it writes 48 bytes to the pipe with writev(), and then uses
fcntl() to set O_NONBLOCK on the pipe.  Then it tries to read()
8 bytes from the pipe and gets an EAGAIN, at which point you see
the poll().

Also, if I repeat the xhost with DISPLAY set to "localhost:0" instead,
it does much the same thing, except that it opens a socket instead of
a pipe.  (It still writes 48 bytes, then sets O_NONBLOCK, then hangs
trying to read from the socket.)

So, it would appear that for whatever reason, the X server is just
not responding.  Maybe this is something that dtlogin does on purpose
to lock down the server, because if I go to the machine and login
through dtlogin (thus starting a regular X session), then the xhost
proceeds without hanging.

   - Logan
0
Reply Logan 1/23/2006 10:43:04 PM

Logan Shaw <lshaw-usenet@austin.rr.com> wrote:
> So, it would appear that for whatever reason, the X server is just
> not responding.  Maybe this is something that dtlogin does on purpose
> to lock down the server, because if I go to the machine and login
> through dtlogin (thus starting a regular X session), then the xhost
> proceeds without hanging.

Yes, that's true.  Are you saying you're trying to talk to a 'dtlogin' X
server rather one that's been logged into?

dtlogin does a screen grab.  This improves security in some cases but
keeps other clients from communicating, even with the proper key.

You can disable it in /etc/dt/config/Xconfig (make a copy from
/usr/dt/config/Xconfig if not present).

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/24/2006 12:20:59 AM

Darren Dunham wrote:
> Logan Shaw <lshaw-usenet@austin.rr.com> wrote:
>> So, it would appear that for whatever reason, the X server is just
>> not responding.  Maybe this is something that dtlogin does on purpose
>> to lock down the server, because if I go to the machine and login
>> through dtlogin (thus starting a regular X session), then the xhost
>> proceeds without hanging.
> 
> Yes, that's true.  Are you saying you're trying to talk to a 'dtlogin' X
> server rather one that's been logged into?

I'm saying that if I try to talk to a dtlogin-"owned" X server, then
it does exactly what the original poster says is happening to him,
down to the hanging on the same system call with the same arguments.

> dtlogin does a screen grab.  This improves security in some cases but
> keeps other clients from communicating, even with the proper key.

Ahh....  So the explanation of the original poster's situation may be
that something (possibly dtlogin, possibly something else) is grabbing
the X server.  That makes quite a bit of sense, actually.

   - Logan
0
Reply Logan 1/24/2006 1:18:03 AM

lan.shen@stpete.org writes in comp.unix.solaris:
|export DISPLAY=hostname:0.0
|xhost
|
|then hang forever. any idea please?

If the X server is running on hostname, then it's probably grabbed by
another process, such as a screen lock or login screen.    When the 
X server is grabbed, it ignores all other connections, which is why it
should only be done rarely when you expect other clients to be running.

-- 
Alan Coopersmith * alanc@alum.calberkeley.org * Alan.Coopersmith@Sun.COM
  http://blogs.sun.com/alanc/ *  http://people.freedesktop.org/~alanc/
   http://del.icio.us/alanc/  *  http://www.csua.berkeley.edu/~alanc/
  Working for, but definitely not speaking for, Sun Microsystems, Inc.
0
Reply Alan 1/25/2006 4:28:59 PM

12 Replies
528 Views

(page loaded in 0.117 seconds)

Similiar Articles:


















7/20/2012 3:52:06 AM


Reply: