[squeak-dev] running headless on Mac OS X
Mark Volkmann
mark at ociweb.com
Tue Oct 7 01:39:03 UTC 2008
Okay, I think I've got a handle on how StartUpList and ShutDownList in
SystemDictionary are used.
1) I created a class named MyApplication and gave it a class startUp
method that creates a text file.
2) I added MyApplication to the SystemDictionary StartUpList and saved
the image.
When I start the image from the command line using "squeak
$SQUEAK_IMAGE cmdline.st", it does create the text file. Success!
However, the UI doesn't respond to the mouse when I start it this way
so I have to kill Squeak from the OS.
When I run it with "squeak -headless $SQUEAK_IMAGE cmdline.st", it
just hangs and doesn't write the file.
I'm running on Mac OS X using Squeak-Dev 3.10.
Any idea why either of these problems is happening?
On Oct 5, 2008, at 8:13 PM, John M McIntosh wrote:
> Well actually I think you can alter the info.plist and set
> LSBackgroundOnly to YES
> the alter the SqueakImageName to point to the image you want to run
> the invoke open Squeak.app and it should open as background
> application, no icon in dock
> and run the image file that is found via the SqueakImageName
>
> However it appears you are doing scripting? via supplying a *.st
> file at startup time.
> Try to get it to work with a UI first, then try the headless option
> or LSBackgroundOnly
>
> On Oct 5, 2008, at 5:06 PM, Mark Volkmann wrote:
>
>> I need to run Squeak in headless mode on Mac OS X. As far as I
>> know, this is the way to do it.
>>
>> 1) Open a Terminal window.
>>
>> 2) Create a symbolic link by entering
>> ln -s "$SQUEAK_VM_DIR/Squeak{version}.app/Contents/MacOS/Squeak
>> VM Opt" squeak
>>
>> 3) Create a text file with a ".st" file extension and add a
>> sequence of Smalltalk statements in it.
>>
>> 4) Enter the following:
>> squeak -headless $SQUEAK_IMAGE {filename}.st
>>
>> When I do this, I don't get any errors, but it just hangs. Here's
>> what I have in the .st file I'm running ... pretty simple.
>>
>> fs := FileStream newFileNamed: 'cmdline.txt'.
>> fs nextPutAll: 'line 1'; cr.
>> fs nextPutAll: 'line 2'.
>> fs.close
>>
>> Any idea why it doesn't exit? Maybe I need to do something more at
>> the end of the .st file.
>>
>> Maybe it's related to this. If I run "squeak $SQUEAK_IMAGE", it
>> tries to start the Squeak UI, but I get an Information dialog that
>> says "Squeak cannot locate the sources file named /Users.Mark/
>> SqueakV39.sources". I copied the .sources file to my home directory
>> and ran it again. This time the UI came up, but it doesn't respond
>> to mouse clicks.
---
Mark Volkmann
More information about the Squeak-dev
mailing list
|