[Techtalk] trying to get xmon to work...
Almut Behrens
almut-behrens at gmx.net
Thu Nov 4 20:00:28 EST 2004
On Wed, Nov 03, 2004 at 09:37:43PM +0100, Riccarda Cassini wrote:
> Problem is, I always get
>
> XIO: fatal IO error 104 (Connection reset by peer) on X server "localhost:1.0"
> after 0 requests (0 known processed) with 0 events remaining.
>
> And in the other terminal, where I ran "xmonui | xmond", the following
> error message is written:
>
> gethostbyname failed: No such file or directory
> Can't open connection to Server
I bet your DISPLAY is set to "unix:0.0" (originally, in the terminal
where you run xmond). How do I know? Well, been there... :)
Due to the way the xmond code is written, this doesn't work, as it'll
call gethostbyname(3) on "unix"... which is not very useful, as "unix"
is just a special tag (not a real hostname) meaning to use unix domain
sockets instead of INET/TCP sockets to connect to a local X server.
The normal Xlib code does handle this properly, but in any home-grown
code (like xmond) the programmer needs to take care of this herself...
IOW, things will most probably start to work if you put a real hostname
(or IP address) in front of the display number ":0.0" -- something that
gethostbyname can resolve (--> DISPLAY=<your.hostname>:0.0).
However, the side effect of this is that xmond will try to open a TCP
socket to the X server. So, I expect you're gonna run into the next
problem, there ;) Most modern distros by default configure the X
server to only allow local (i.e. unix domain socket) connections.
For this, the X server is started with the option -nolisten tcp.
(To check, you could run "ps ax | grep /X" -- you'll probably see
something like /usr/X11R6/bin/X vt7 -dpi 100 -nolisten tcp -auth ... )
This is for security reasons, to minimize the number of open ports.
BTW, display number :0 corresponds to port 6000, :1 to 6001, and so on,
so you can also run netstat to check if your X server is listening on
port 600X ...
You'll need to remove that "-nolisten tcp", at least temporarily, and
restart X. (In debian, this is configured in /etc/X11/xinit/xserverrc)
Have fun debugging! (or let me know, if things still don't work...)
Ciao bella :)
Almut
More information about the Techtalk
mailing list