[squeak-dev] running headless on Mac OS X

Mark Volkmann mark at ociweb.com
Mon Oct 6 01:26:32 UTC 2008

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

Thanks for the advice!

The code below that writes two lines to a text file named  
"cmdline.txt" does work when run in the UI, but when I try to run that  
code from a .st file using -headless, it hangs.

Do you think I'd be better off to put the code in an image and  
customize the image so it runs headless? I don't really have a  
preference. I just need a pointer to some documentation on how to do  
it either way. For example, I don't yet know how to configure an image  
to tell it that I want certain code to run when the image starts up.

> 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