=== Top of the Swiki === Attachments ===
FAQ: Headless Image
Q: How can squeak run headless?
A: (See also VmCommandLineOptions to start up Squeak without the main window.)On WindowsNT:
- Create a service by executing at the prompt:
c:\squeak\squeak.exe -memory: 4 -log: "C:\Squeak\vm.log" -service: "Swiki" "C:\Squeak\SwikiSqueak.image"
- For letting your image do 'something' at start up time you have different options:
- you can add a class to the StartUpList of SystemDictionary so it will get an startUp message at the service startUp. For example, if you want the PWS automatically to start up, add it to the startUpLis by executing: 'SystemDictionary addToStartUpList: PWS'.
Create the method 'startUp' at the class side of PWS with: '[PWS serveOnPort: 80 loggingTo: 'log.txt'] fork.
- Another option is:
Smalltalk snapshot: true andQuit: true.
"All your restore stuff goes here"
PWS serveOnPort: 80 loggingTo: 'log.txt'
Select all of this and DoIt. Your image will save-and-quit...IN THE
MIDDLE OF THE DOIT. When this image starts up, it continues the
DoIt, which is the restore and the PWS startup.
- Possibly a third option is giving arguments (scripts) to the image at startup. see: FAQ: Writing Scripts
- Somehow, running headless doesn't work well when your image starts up with an morphic project, so you should have saved your image in a MVC project. A possible MVC project is the project where you find the 'play with me's.
I was able to answer this FAQ by collecting some work of Andreas Raab and Mark Guzdial.
Thanks, Mathieu van Echtelt