[squeak-dev] running headless

David T. Lewis lewis at mail.msen.com
Thu Oct 23 03:47:50 UTC 2008

On Sun, Oct 19, 2008 at 02:06:29PM -0500, Mark Volkmann wrote:
> I found the following example of using the -headless command-line  
> option related to Swiki.
> ---
> squeak -headless squeak.image config.st
> The Configuration File config.st looks something like this:
> ComSwikiLauncher allInstances do:
> [ :instance |
>   instance port: 8000.
>   instance isOn ifTrue: [ instance stopServer ].
>   instance startServer.
> ].!
> ---
> Why does the last line end in ".!"?

The "!" character is a delimiter for a "chunk" of code in the traditional
Smalltalk "fileout" format (http://wiki.squeak.org/squeak/1105). It is
probably not necessary in this script, but harmless.

The period is a statement terminator, definitely not required in the
above script, but also harmless.

> I've been struggling for weeks to get anything to work with -headless  
> on both Mac OS X and Windows. Based on the lack of replies to my  
> questions on this it seems fair to conclude that this feature isn't  
> used by most Squeak developers. Is that the case?
> I'd love to see a simple example of a .st file that can be used with - 
> headless. More than anything I'd love to get some confirmation that - 
> headless actually works for somebody.

The "-headless" option definitely works for the unix VM. I don't know
about OS X or Windows.

If you are trying to get a start script working, start by getting it
to work with the normal Squeak UI. After you have this working, add
the "-headless" option to make the UI go away.

If you are having trouble getting the script file to run, try using
a fully qualified path name:

$ squeak myimage.image /path/to/my/script.st

IIRC, some versions of the VM may require syntax like this:

$ squeak myimage.image file:///path/to/my/script.st


More information about the Squeak-dev mailing list