Operating System - Tru64 Unix
1748198 Members
2582 Online
108759 Solutions
New Discussion юеВ

Re: Xhost/Xlib error

 
sammysammy
Frequent Advisor

Re: Xhost/Xlib error

so if there is someone already logged in the X (graphical) console there, I will have this xhost + error message? is that what you meant?
If this is the case, I will need to kill all login session before executing xhost +

Thanks
Steven Schweda
Honored Contributor

Re: Xhost/Xlib error

If someone _else_ is logged in there, then
you will get that error. If you log in as
the _same_ user as is logged in there, and
set your DISPLAY the same as that user, or if
you "su other_user" (and set your DISPLAY the
same), then it should work.

And you may not need to do the "xhost +"
unless you stop being "other_user".
sammysammy
Frequent Advisor

Re: Xhost/Xlib error

If I killed all xterm in the system, then logged in the server as root from my windows, and set DISPLAY=tserver:0 , export DISPLAY, will xhost + works in this way?
Here is a list of xterm alraedy running in the system:
# ps -ef | grep -i term
root 131890 1 0.0 Apr 02 ?? 0:08.42 xterm
root 132135 1 0.0 Apr 02 ?? 3:12.84 xterm
root 208916 1 0.0 Mar 26 ?? 0:03.54 xterm
root 495300 1 0.0 Mar 22 ?? 1:41.78 xterm -geometry 80x24+10+10 -ls -title X Desktop
root 495407 495362 0.0 Mar 22 pts/5 0:15.71 xterm
root 131674 497279 0.0 Apr 02 pts/8 0:01.05 xterm
root 315419 313855 0.0 13:16:31 pts/15 0:00.00 grep -i term

Thanks
Steven Schweda
Honored Contributor

Re: Xhost/Xlib error

The problem is not the xterms, it's whom the
X server trusts. If user "fred" is logged in
at the console, then user "fred" controls
these things, and normally only user "fred"
can do an "xhost" command.

However, user "root" can do "su fred", and
then he can do the same things that user
"fred" can do.

Here, with user "sms" logged in at the Tru64
console:

alp $ rsh /user = sms urtx
[...]
urtx> who am i
sms pts/4 Apr 4 22:44 (alp.antinode.org)

urtx> export DISPLAY=:0.0
urtx> xhost
access control enabled, only authorized clients can connect


alp $ rsh /user = root urtx
[...]
urtx# who am i
root pts/4 Apr 4 22:45 (alp.antinode.org)

urtx# export DISPLAY=:0.0
urtx# xhost
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display ":0.0"

But:

urtx# su sms
urtx# export DISPLAY=:0.0
urtx# xhost
access control enabled, only authorized clients can connect

Problem solved (again).
sammysammy
Frequent Advisor

Re: Xhost/Xlib error

I am not sure which user have executed export DISPLAY in my enviornment. Is there any way I can tell which user account had actually executed export DISPLAY and xhost +?

Thanks
Steven Schweda
Honored Contributor

Re: Xhost/Xlib error

The question is not about anyone's DISPLAY
variable, it's about who's logged in at the
graphics console. This would seem to be the
user who owns the "dtsession" process:

urtx# ps -ef | grep /usr/dt/bin/dtsession | grep -v grep
sms 1838 1816 0.0 22:02:42 ?? 0:00.41 /usr/dt/bin/dtsession

In this case, it's "sms". If you don't find
it, then no one's logged in there, and you're
back to a previous problem.
sammysammy
Frequent Advisor

Re: Xhost/Xlib error

In my case,
ps -ef | grep /usr/dt/bin/dtsession | grep -v grep
returns nothing.

Thanks
Steven Schweda
Honored Contributor

Re: Xhost/Xlib error

> In my case,
> ps -ef | grep /usr/dt/bin/dtsession | grep -v grep
> returns nothing.

Which is what I'd expect after you killed the
X server, and before anyone has logged in
again at the console.

Look back at the part about "If no one is
logged in there, who will be looking at the
stuff you want to put onto the display?"

If someone _is_ logged in there (and that
user's name does not include the string
"grep"), and it _still_ shows nothing, then
I'm lost.
sammysammy
Frequent Advisor

Re: Xhost/Xlib error

Is there any log files I can look into?

thanks
Steven Schweda
Honored Contributor

Re: Xhost/Xlib error

> Is there any log files I can look into?

For what? Are you saying that there _is_ a
user logged in at the graphics console, but
there's no dtsession process?