[vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

Steve Whitson
I would like to present text prompts when an X11 server is unavailable.  
Does anyone know how to detect/catch "Unable to connect to X11 server"?

Thanks,
           -Steve
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

Steve Whitson
Bump

Any ideas would be greatly appreciated.  Thanks,
    -Steve


Steve Whitson wrote:
I would like to present text prompts when an X11 server is unavailable.  Does anyone know how to handle/detect when "Unable to connect to X11 server"?

Thanks,
          -Steve


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

thomas.hawker

Steve,

 

This kind of thing can be detected, if it’s possible at all, through the subsystem logic during that part of the system that initializes the “Screen” environment.  There are several steps to it, and I’m not sure that you get any indication, from the VM to the image, that it can’t find an X11 server.  This might be a condition where the VM fails and does not raise the equivalent of a “primitive failed” exception in the image.  So, the first case is to see whether this gets raised to the image at all.  If it does, you can look for and trap whatever exception gets raised.  Did you check whether this message text is found in the image anywhere?

 

If it doesn’t, there may be a way to trick the system into telling you – but not if the VM exits without giving you any warning at all.  The only thing I can think of would be to use the subsystem logic.  I’ve never tried to do what I’m suggesting, but there are places in the documentation that suggest it is possible.  Consider doing the following:

 

  1. Start the image headless – that is, make sure that regardless of whatever explicit GUI setting is made on the command line, you always start without the physical visual graphics system started.
  2. Somewhere late in the process, when you have enough running you have some measure of control over a response, reverse the headless settings and activities and start the real graphics system.  Hopefully, the VM will give you that exception you can trap.
  3. If the server can’t be started, do something smart, like assume you’re connected to the console (using stdin and stdout streams).

 

Be very, very careful if you make any changes to the way the subsystem logic behaves.  If you screw it up, your image will crash, hang, or loop and you won’t be able to do anything about it.  I suggest for item (2) that you make this switch after everything else is running – such as file system access – so that, if you get an exception, you can dump a stack trace to an external transcript or log file.  Otherwise, you will have no clue what happened, assuming you can get that dump in the first place.  (Adding special handling for various signals, such as through the ObjectMemory external event registry, may help here.)

 

Cheers!

 

Tom Hawker

Senior Framework Developer

Home

+1 (408) 274-4128

The Environment:

We take it personally

Office

+1 (408) 576-6591

Mobile

+1 (408) 835-3643

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Steve Whitson
Sent: Wednesday, June 03, 2009 9:44 AM
To: [hidden email]
Subject: Re: [vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

 

Bump

Any ideas would be greatly appreciated.  Thanks,
    -Steve


Steve Whitson wrote:

I would like to present text prompts when an X11 server is unavailable.  Does anyone know how to handle/detect when "Unable to connect to X11 server"?

Thanks,
          -Steve

 

IMPORTANT NOTICE
Email from OOCL is confidential and may be legally privileged.  If it is not
intended for you, please delete it immediately unread.  The internet
cannot guarantee that this communication is free of viruses, interception
or interference and anyone who communicates with us by email is taken
to accept the risks in doing so.  Without limitation, OOCL and its affiliates
accept no liability whatsoever and howsoever arising in connection with
the use of this email.  Under no circumstances shall this email constitute
a binding agreement to carry or for provision of carriage services by OOCL,
which is subject to the availability of carrier's equipment and vessels and
the terms and conditions of OOCL's standard bill of lading which is also
available at http://www.oocl.com.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

Steve Whitson
Thanks much Thomas!

I suspect that the image doesn't receive the X11 error.  I'll see what I can figure out, possibly with the help of others that know the VM better than I :).

The notion of starting the image headless, then attempting to go headful, and handling it when the image cannot, sounds plausible.  A great alternative to try if needed.

-Steve

[hidden email] wrote:

Steve,

 

This kind of thing can be detected, if it’s possible at all, through the subsystem logic during that part of the system that initializes the “Screen” environment.  There are several steps to it, and I’m not sure that you get any indication, from the VM to the image, that it can’t find an X11 server.  This might be a condition where the VM fails and does not raise the equivalent of a “primitive failed” exception in the image.  So, the first case is to see whether this gets raised to the image at all.  If it does, you can look for and trap whatever exception gets raised.  Did you check whether this message text is found in the image anywhere?

 

If it doesn’t, there may be a way to trick the system into telling you – but not if the VM exits without giving you any warning at all.  The only thing I can think of would be to use the subsystem logic.  I’ve never tried to do what I’m suggesting, but there are places in the documentation that suggest it is possible.  Consider doing the following:

 

  1. Start the image headless – that is, make sure that regardless of whatever explicit GUI setting is made on the command line, you always start without the physical visual graphics system started.
  2. Somewhere late in the process, when you have enough running you have some measure of control over a response, reverse the headless settings and activities and start the real graphics system.  Hopefully, the VM will give you that exception you can trap.
  3. If the server can’t be started, do something smart, like assume you’re connected to the console (using stdin and stdout streams).

 

Be very, very careful if you make any changes to the way the subsystem logic behaves.  If you screw it up, your image will crash, hang, or loop and you won’t be able to do anything about it.  I suggest for item (2) that you make this switch after everything else is running – such as file system access – so that, if you get an exception, you can dump a stack trace to an external transcript or log file.  Otherwise, you will have no clue what happened, assuming you can get that dump in the first place.  (Adding special handling for various signals, such as through the ObjectMemory external event registry, may help here.)

 

Cheers!

 

Tom Hawker

Senior Framework Developer

Home

+1 (408) 274-4128

The Environment:

We take it personally

Office

+1 (408) 576-6591

Mobile

+1 (408) 835-3643

 


From: [hidden email] [[hidden email]] On Behalf Of Steve Whitson
Sent: Wednesday, June 03, 2009 9:44 AM
To: [hidden email]
Subject: Re: [vwnc] any ideas on how to detect/catch "Unable to connect to X11 server"?

 

Bump

Any ideas would be greatly appreciated.  Thanks,
    -Steve


Steve Whitson wrote:

I would like to present text prompts when an X11 server is unavailable.  Does anyone know how to handle/detect when "Unable to connect to X11 server"?

Thanks,
          -Steve

 

IMPORTANT NOTICE
Email from OOCL is confidential and may be legally privileged.  If it is not
intended for you, please delete it immediately unread.  The internet
cannot guarantee that this communication is free of viruses, interception
or interference and anyone who communicates with us by email is taken
to accept the risks in doing so.  Without limitation, OOCL and its affiliates
accept no liability whatsoever and howsoever arising in connection with
the use of this email.  Under no circumstances shall this email constitute
a binding agreement to carry or for provision of carriage services by OOCL,
which is subject to the availability of carrier's equipment and vessels and
the terms and conditions of OOCL's standard bill of lading which is also
available at http://www.oocl.com.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc