Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Can't open display

Status
Not open for further replies.

VPMAN

IS-IT--Management
Apr 11, 2002
10
US
I am attempting to install SCO in another machine. Everything seems to be working. But one of the program fails. When I run the program like this (directly at the command prompt of a text-based terminal session):
sh <program-name> 123

I get the following error message:
Error: Can't open display: cfc:0.0

When I try the same program in the old machine (directly at the command prompt of a text-based terminal session), it works fine. I only have this problem with the new machine.

I have already tried the following command. But it doesn't help:
DISPLAY=:0
export

Please help.

Thanks in advance for any info on this problem.
 
I have digged into this problem a bit deeper, and I find that the shell script sets its own copy of DISPLAY variable (this explains the reason why setting the DISPLAY variable before running the script doesn't help). The script is like this:
. . .
DISPLAY=cyber2:0.0
. . .
export DISPLAY
. . .
<the program that is showing the error message>

Seem like this problem has to do with DNS resolution. I have defined &quot;cyber2&quot; as the host-name in /etc/hosts file, and I am using this host-name inside the shell script. I also see this host-name when I use the &quot;hostname&quot; command at the command line. In other words, the host-name settings are:
/etc/hosts...............: cyber2
&quot;hostname&quot; command shows.: cyber2
Shell script DISPLAY uses: cyber2:0.0
Result...................: Can't open display cyber2:0.0

The configuration &quot;looks&quot; good. But this doesn't work. I have a feeling that something is missing, and the thing that is missing is causing the program from going through.

The reason why I have this feeling is that the host-name that the configuration in the old machine is different from the new machine:
/etc/hosts...............: cyber
&quot;hostname&quot; command shows.: cfc.ourcompany.com
Shell script DISPLAY uses: cfc:0.0
Result...................: Run OK

Seem like we have failed to set one of the configuration in the new machine to match the one in the old machine.

Does anyone know anything about this?

Thanks.
 
Actually we are not sure if it is an X-application or not. We always run this program (via the shell script) remotely using RSH from a DOS command prompt (I guess it is in text mode). I don't see any reason why it can be an X-application because it doesn't have any interface other than the command line interface.
 
Trust me: it's an X app if it's setting DISPLAY like that.

Or the person who wrote it is very confused. Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
I have received other responses to this post but I was still having problems. Based on other responses I believe that the application we are running in a SCO Unix window might be an X application. But what I do not understand is that we have done the same process for many years on a previous SCO machine. We have now created a new SCO and simply copied all required files to the new SCO. All permission, creation dates and files sizes have been checked to assure both machine are the same.

The actual command we run is as follow, “rsh IPaddress –l username sh nwcmdedz parameter”. This is executed from an NT4 server over to the SCO server, and it always worked. The content of the file nwcmdedz follows,
DEV=/u/cyb/tmp
SYS=/u/cyb
DISPLAY=cyber2:0.0
PATH=/bin:/u0/cyb/log:/u/cyb/X/bin:/u/cyb/bin:/u/cyb/part:/u/cfc1:
export DEV
export SYS
export PATH
export DISPLAY
cd /u/cfc1/work/$1
ductpX -a $1
The ductpX is of course the actual program. When the script is executed the error message reads,
Error: Can't open display: cyber2:0.0
Cyber2 is the hostname for the SCO machine we are trying to run this on.

I have tried this by manually typing each command directly on the new SCO in a Unix window as well as running it as shown above (rsh). I have also tried typing in “ductpX –a parameter” directly. Regardless of how I run it I get the same error (Error: Can't open display: cyber2:0.0).

The following is the output from uname –X for the two SCO involved.
Original SCO
System = SCO_SV, Node = cfc, Release = 3.2v5.0.2, KernelID = 96/01/23, Machine = Pentium, BusType = ISA
New SCO
System = SCO_SV, Node = cyber2, Release = 3.2v5.0., KernelID = 2000-07, Machine = PentIII, BusType = ISA, and Release Supplement 506A

Does anyone have any other ideas based on these additional details? How would I check the hostname, :display_number and screen_number for a particular SCO machine to assure I am using the correct parameter in the DISPLAY environment variable?

Thank you in advance for any assistance you can provide.

Nick Scheidel
 
man xhost

Cyber2 hasn't given permission for the nt box to use its display. The display also has to be up and running.

xhost +ntbox

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Thnaks for the info.

When i try the xhost command i get the following message. I hve tried it a number of way, three of which are shown.

$ /usr/bin/X11/xhost +
Xlib: connection to &quot;:0.0&quot; refused by server
Xlib: Client is not authorized to connect to Server
/usr/bin/X11/xhost: unable to open display &quot;:0.0&quot;

$ /usr/bin/X11/xhost + sqlserver
Xlib: connection to &quot;:0.0&quot; refused by server
Xlib: Client is not authorized to connect to Server
/usr/bin/X11/xhost: unable to open display &quot;:0.0&quot;

$ /usr/bin/X11/xhost + n.n.n.n ;where n.n.n.n is an IP add.
Xlib: connection to &quot;:0.0&quot; refused by server
Xlib: Client is not authorized to connect to Server
/usr/bin/X11/xhost: unable to open display &quot;:0.0&quot;
 
Umm, I don't think you understand. You can't do that in your script- you have to do it as the user who is running the display.


In other words, start up a term on the desktop, and there do xhost +ntbox or whatever it is.

I cannot remember the file OSR5 keeps this in- maybe .Xauthority ?? If so, you could just add the nt box there.



Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top