Igor, Headless support is an important feature. It should be something simple so that it can be used in many ways. I would suggest to read chapter 20 of the VW Application Developers Guide (it is only 10 pages). They basically have the option to toggle between headless and headfull. This is not detected automatically, but a global switch (with a test method). In headless mode all display access results in an error. In headless mode all Transcript output (can/is) also sent to a file (stdout would be another option). What is interesting (and we might make that an option) is that the 'no display' error results in the image being saved 'headfull' so that you can start it up using a display to debug it (suspended process/debugger). Saving a headless image headfull can also be done programmatically. I don't think more than that is needed. There are many options to interact with headless images, forcing one on people would not be good, the same goes for command line parsing, preferences, startup files, ... These other options could become separate projects. I would be an interested user and if I can will try to help. Regards, Sven On 20 Jan 2011, at 21:39, Igor Stasenko wrote:
Hello folks.
I'd like to ask, if there any 'standartized' instruments for headless images (or alike).
I need a simple things: - redirect all ToolSet/UIManager messages to Transcript - redirect Transcript logging to file or stdout
in short, these tools should serve a simple, yet important purpose: - if image runs in headless mode, it should suppress anything which expecting user interaction (like showing warnings with 'continue' button) and either log such messages to file or simply quit image with error message.
Without such tool it is quite difficult to monitor, what happens with your headless image.. unless you have RFB installed.. but that is different and unrelated story.
I did a prototype once for Hydra (you can check it at SqS/HydraVM/HydraVM.mcz package) there are two subclasses: - MorphicUIManager subclass: #HydraUIManager - StandardToolSet subclass: #HydraDebugToolSet
and - WriteStream subclass: #HydraTranscript
which can be installed as a Transcript.
And in order to prepare image to run in headless mode, i issued: ToolSet unregister: StandardToolSet. ToolSet register: HydraDebugToolSet. UIManager default: HydraUIManager new.
Also, HydraTranscript startUp does something like:
TranscriptStream newTranscript: (self basicNew initialize on: (String new: 1000))
With that i could run the image in headless mode, knowing that in case of error or warning etc, all will be redirected to transcript, moreover i even stopped the UI process, so it never run on headless images.
I wonder if there are other work, which can offer similar, and is there any way to detect that image are running in headless mode?
-- Best regards, Igor Stasenko AKA sig.