Operating System - HP-UX
1752277 Members
4490 Online
108786 Solutions
New Discussion юеВ

Re: xhost+$HOSTNAME hangs..

 
kumasudh
Advisor

xhost+$HOSTNAME hangs..

Hi Gurus,

I am facing some problem with xhost on my HP-UX11.23 machine. When i try to do

xhost + $HOSTNAME 1>/dev/null 2>/dev/null
in a script, this hangs. When i tried to check what exactly this command returned by redirecting it into a file, the file was empty as nothing was written. Could you please tell me what should i check to troubleshoot this problem. Here is the CDE/X11 software version

#swlist |grep -e CDE
CDE-English B.11.23.0409 English CDE Environment
INP hpsep2t:/var/tmp#swlist -l product |grep -i x11
PHSS_36603 1.0 X11 Font Library Patch
X11 B.11.23 HP-UX X Window Software

Best Regards
Sudhir
5 REPLIES 5
mvpel
Trusted Contributor

Re: xhost+$HOSTNAME hangs..

I'd suggest downloading the "tusc" command - "Trace Unix System Calls." This will show you exactly what the xhost command is doing and when it hangs, you'll be able to see exactly what it's waiting for.

I note in your command line in the body of your post, you have a space between "+" and "$HOSTNAME" - there should not be a space:

xhost +$HOSTNAME 1>/dev/null 2>/dev/null

For security's sake you should probably make sure that $HOSTNAME is not null, if you don't already.
kumasudh
Advisor

Re: xhost+$HOSTNAME hangs..

Hi mvpel,

Thanks a lot for the reply. Yes, i have already notified about my collegue about tusc. Is there anything else which i can check in between ?
Regarding the space between "xhost + $HOSTNAME", this is syntactically correct. If you remove the spaces between xhost and + and $HOSTNAME, it will throw error.

Best Regards
Sudhir
Christopher Eubank
Occasional Visitor

Re: xhost+$HOSTNAME hangs..

Sounds like a potential DNS issue. Can whatever ${HOSTNAME} is, resolve to an actual IP address?
Steven Schweda
Honored Contributor

Re: xhost+$HOSTNAME hangs..

> Regarding the space between "xhost +
> $HOSTNAME", this is syntactically correct.
> If you remove the spaces between xhost and
> + and $HOSTNAME, it will throw error.

Not really. The space after "xhost" is
required; the space after "+" is not.

man xhost

It would, of course, be interesting to see
what "$HOSTNAME" actually is. Also, what
"$DISPLAY" is, because "xhost" expects to
talk to the X display.
Horia Chirculescu
Honored Contributor

Re: xhost+$HOSTNAME hangs..

Hello,

From man xhost:

[+]name The given name (the plus sign is optional)

If the plus sign is optional, you could use in your script this:

xhost $HOSTNAME 1>/dev/null 2>/dev/null

Depending on your script/shell used, if you are using strings, '+' have a special meaning (concatenating 2 strings).


Best regards,
Horia.
Best regards from Romania,
Horia.