Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2006 12:22:04 -0800
From:      Rob <rob@roblytle.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: problem regarding setting DISPLAY env variable and hostname
Message-ID:  <20060223122204.387b03ff.rob@roblytle.org>

next in thread | raw e-mail | index | archive | help
Sorry, forgot to copy the list.



Begin forwarded message:

Date: Thu, 23 Feb 2006 10:23:47 -0800
From: Rob <rob@roblytle.org>
To: Giorgos Keramidas <keramida@ceid.upatras.gr>
Subject: Re: problem regarding setting DISPLAY env variable and hostname


On Thu, 23 Feb 2006 19:26:28 +0200
Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:

> On 2006-02-23 08:23, Rob <rob@roblytle.org> wrote:
> > Sorry if you get this twice Rob as I mistakenly
> > sent my reply only to you without including the list
> >
> > I had the same problem.  Add this line to your
> > .xinitrc file
> >
> > xdpyinfo -display :0.0
> >
> > The hostname is not specified.
> >
> > --Duane
> > --------------------------------
> >
> > Hi Duane,
> >
> > I put the line you suggest into .xinitrc, but I still have the
> > same problem.  I also went into /etc/hosts after doing this and
> > tried two ways of setting hosts:
> >
> > 1.  127.0.0.1  localhost   xenon
> > 2   127.0.0.1  localhost
> 
> What are the "1." and "2" at the beginning of the lines above?
> I hope they are not part of your /etc/hosts file.
> 
> You have obviously messed up your /etc/hosts file too much.
> Before you do anything else, please restore it from the sources,
> by copying `/usr/src/etc/hosts' over it.  Then re-add "xenon" at
> the localhost line.
> 
> > But I am still seeing the "out of display lists" message.
> >
> > It seems like the xdpyinfo command does not do anything.
> 
> It does.  It prints a lot information about the current display.  Since
> this goes to the terminal where xdpyinfo was started, then it goes to
> the virtual console that you start X11 in.  You won't see much, until
> you exit X11.
> 
> > The only thing that I have done which changes the error message is to
> > set /etc/rc.conf hostname="xenon" Then in .bash_profile put
> > "DISPLAY=xenon:0.0 export DISPLAY"
> 
> No.  That's a *horrible* idea.  The `startx' utility can start an X11
> server with a slightly different display, i.e. with:
> 
>     $ startx -- :1
> 
> Then your .bash_profile will override the default DISPLAY of the X11
> session, messing up everything.  If you happen to run two X11 sessions
> at the same time, you will be opening windows in the first session no
> matter where you run the commands that you will use.
> 
> > Then I get the different error message:
> >
> > "_X11TransSocketINETConnect() can't get address for xenon:6000: hostname nor servname provided, or not known
> > Error: Can't open display: xenon:0.0"
> 
> The error message means you still have name resolution problems.  Your
> system doesn't know that "xenon", "localhost", "127.0.0.1" are all
> equivalents ways of referring to itself.
> 
> > So I guess now I have tried every combination of the following:
> >
> > setting hostname in rc.conf to either "" or "xenon"
> > setting "DISPLAY=xenon:0.0" or leaving that line out in .bash_profile
> 
> A hostname of "" is wrong.
> 
> A hostname of "xenon" is almost right.
> 
> > And finally, putting in xinitrc "xdpyinfo -display :0.0 or just
> > leaving that line out.
> 
> This should be without any real side-effects regarding the way your X11
> session works.
> 
> Please, restore your /etc/hosts file from /usr/src/etc/hosts and then
> we'll see what other may be wrong with your current setup.
> 
> - Giorgos
> 
> 

Thank you very much Giorgos for keeping with me on this problem!


Here are all of the steps which I have just done:

I. I copied /usr/src/etc/hosts to /etc/hosts.  Now it looks like:

::1             localhost       localhost.my.domain
127.0.0.1       localhost       localhost.my.domain

everything else is commented out

2.  I confirmed that   hostname="xenon" is still in rc.conf

3.  I checked /root/.cshrc  has no Xorg related commands in it,
just a couple of aliases that I added to the original file.

4.  The user  .bash_profile  no longer has the  "DISPLAY=xenon:0.0 export DISPLAY" in it.  The .xinitrc no longer has the 
xdpyinfo -display :0.0  line in it.

5.  I rebooted.  Sendmail starts up fine now.

6.  So I started up Xorg and I get the errors on startup:

bad display name "xenon:0  in "list" command

and then upon Xorg shutdown:

bad display name "xenon:0" in "remove" command   

7.  I gave the command  "xhost +localhost"  at the xterm prompt

I get:  localhost being added to access control list

8.  I su at the xterm prompt and then give the command

setenv DISPLAY localhost:0.0      all ok

9.  then I try to run an X related program from the xterm command prompt
and get the error:

Error: Can't open display localhost:0.0

However, non X type programs like vi start ok without errors

I guess my next step will be to add the host "xenon" to /etc/hosts. Then it
looks like this:

::1             localhost       xenon
127.0.0.1       localhost       xenon

Is that correct?

Thanks,

Rob.



-- 

-----------------------
http://www.roblytle.org
Rob Lytle Home Page


-- 

-----------------------
http://www.roblytle.org
Rob Lytle Home Page



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060223122204.387b03ff.rob>