Re: Problems in setting display variable for X Windows server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On June 25, 2004 04:07 pm, santhosh wrote:
> Hi Pete,
>                  Thanks for those responses and forgive me if I am not
> presenting my case clearly; I will make another attempt
>
>
> The Linux Box IP: 192.168.1.10
> Power analyzer installed on : 192.168.1.10 (i.e. same box)
> Application and web server installed on : 192.168.1.10 (i.e. same box)
> Servlets trying to access the X server through the  Display variable
> localhost:0
> Servlets not able to access the X server resulting in failure to display
> charts
> A log is created in the web server with the reason that the servlet cannot
> connect to the X server through the Display variable
>
> I try to set the display variable, or in other words try to figure out
> whats happening with the display variable
>
> So I try the following commands
>
> ***************************************************************************
>* ********************
>    [root@localhost root]# echo $DSIPLAY
>         (blank)
> [root@localhost root]#
>
> even after I give the command export DISPLAY=localhost:0
> ***************************************************************************
>* ********************
> [root@localhost root]#xterm
> Xlib: connection to "localhost:0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> Warning: This program is an suid-root .........
>
> ***************************************************************************
>* ********************
> [root@localhost root]# xhost
> Xlib: connection to "localhost:0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> xhost:  unable to open display "localhost:0"
>
> ***************************************************************************
>* ********************
> [root@localhost root]# xinit
>
> Fatal server error:
> Server is already active for display 0
>         If this server is no longer running, remove /tmp/.X0-lock
>         and start again.
>
> When reporting a problem related to a server crash, please send
> the full server output, not just the last messages.
> Please report problems to xfree86@xxxxxxxxxxxx
>
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> giving up.
> xinit:  unable to connect to X server
> xinit:  No such process (errno 3):  Server error.
> [root@localhost root]#
>
>
> Now I am struck with it..being unable to go ahead with my application.
>
>
> Hope that I am presenting my problem clear enough so that you don't have to
> take trouble in understanding problems. Meanwhile I have to appreciate the
> job you people are doing to novices like us
>
>
>
> Thanks
> Santhosh
>
>


Have you tried as a non-root user. I just went to a console, with X still 
running, and as root, I cannot execute an xterm, as a regular user (who ownes 
the current X session) if i export the display as localhost:0, my xterm 
command is displayed in the X environment as expedcted. When I try with a 
differnt user, who does not own the :0 session, then I get:

Xlib: connection to "localhost:0.0" refused by server
Xlib: No protocol specified

xterm Xt error: Can't open display: localhost:0
---

So it kinda sounds like a permissions thing. You may have tried this, but as 
the user that the servlet is running under, start an X session, then try 
running "xhost + localhost".

When my user 'pete' runs this from within my X session, then my user 'test' 
can successfully display an xterm on the user 'pete' 's X server.

-- 
Pete Nesbitt, rhce


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux