Operating System - HP-UX
1825764 Members
2018 Online
109687 Solutions
New Discussion

cannot gopen display 'hostname:0.0'

 
SOLVED
Go to solution
Steve Buchan_1
Advisor

cannot gopen display 'hostname:0.0'

I am trying to run a script that starts up a cad program on some workstations. The error is: cannot gopen display 'hostname:0.0'

I have issued: export DISPLAY=hostname:0.0
and: xhost +

I still get this problem though. I have never seen the word 'gopen' in this error before.


I can log into the workstation, and export the display somewhere else and it will work. I can also log into another machine and export the display back to the broken one, and it will work.

What does this mean and how can I fix it?

thanks
10 REPLIES 10
Graham Cameron_1
Honored Contributor

Re: cannot gopen display 'hostname:0.0'

Was there a typo there?
export DISPLAY=hostname:0.0
should be
export DISPLAY=$(hostname):0.0

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Steve Buchan_1
Advisor

Re: cannot gopen display 'hostname:0.0'

uh no typos..u just replaced the actual hostname with the word 'hostname' for the purposes of this post.

I think I have it narrowed down, I just cant figure out why it has happened.

The workstations are failing to reslove their own hostnames. If I use IP addresses instead of hostnames for DISPLAY everything works. hmm. I can work around for the moment since its meant to be my day off!

Any thoughts appreciated
Stefan Farrelly
Honored Contributor
Solution

Re: cannot gopen display 'hostname:0.0'

if your workstations are failing to resolve their own hostnames then it must be a dns problem. How is your /etc/nsswitch.conf setup? files or dns first ? We always run files first so that it will always be able to resolve its own hostname even if dns is playing up or down. Probably your dns server(s) are having problems, not resolving quickly enough ocassionally, thats why only some workstations are affected.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Umapathy S
Honored Contributor

Re: cannot gopen display 'hostname:0.0'

Steve,
Is the DNS working fine? It may be a problem from that end.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Steve Buchan_1
Advisor

Re: cannot gopen display 'hostname:0.0'

ah hah. thats the problem. the workstations that dont work have the hosts line missing from nsswitch.conf, and the ones that do work, have this line.


Cheers
Bill Hassell
Honored Contributor

Re: cannot gopen display 'hostname:0.0'

Because DNS is so critical to networking (and for workstations, CDE is dead without proper name resolution), it is always recommended that /etc/nsswitch.conf have the line:

hosts: files [NOTFOUND=continue UNAVAIL=continue] dns

so that your local hostname can always be resolved without depending on a DNS server. The other advantage is that a small /etc/hosts file containing production machine names/IPaddrs is much faster than asking a DNS server and some programs (like network backups) may ask the DNS server for a name lookup for every file. Having the info in a local file greatly reduces the load on the network and the DNS server.


Bill Hassell, sysadmin
Steve Buchan_1
Advisor

Re: cannot gopen display 'hostname:0.0'

ok, I have now entered the neccessary information into the nsswitch.conf file, and rebooted all the boxes that were affected.

hosts: nis [NOTFOUND=continue UNAVAIL=continue] files

When I log in as root and nslookup the hostname, it resloves, using NIS as excepted.

However, When the user logs in, and trys the same, nslookup still wants to use DNS.

Is there a seperate nsswitch.conf for the users??

This is really confusing me now
Steve Buchan_1
Advisor

Re: cannot gopen display 'hostname:0.0'

permissions on the nsswitch.conf were wrong.
Mike Stroyan
Honored Contributor

Re: cannot gopen display 'hostname:0.0'

By the way, gopen is the Starbase graphics function to connect to a 'device' such as a window. It seems that the first thing the application complained about was trying to use Starbase. That depends internally on the same XOpenDisplay and hostname resolution that a normal X connection uses.
Stefan Farrelly
Honored Contributor

Re: cannot gopen display 'hostname:0.0'

No, there is no separate nsswitch.conf for users - the one in /etc is for all users.
Im from Palmerston North, New Zealand, but somehow ended up in London...