Disclaimer: This is works-for-me-ware. Don't assume that this is officially supported by the Indigo folks. Don't assume that it will work for you until you've tried it. Don't blame me if it doesn't.
Why bother, anyway? Run as a daemon, Indigo can auto-start with the system and run on a Mac without anyone ever having to log in. You can run it as a dedicated user-id (that is not an administrator), which helps with security. It can run headless (say, on that Mac mini in your attic with no display).
Here is what I did: First, as an administrator user, install Indigo (the whole thing, client and server). Using the combined server+client mode, configure the server options the way you like it. Do not ask for automatic server start or restart. Then quit both.
Create a user and group called "indigo". On OS X Server, use Workgroup manager (make a local user and group). On OS X Client, just use the Accounts preference to make a new "normal" user; you will automatically get a group to match. Then change the entire Indigo data directory to that user:
- Code: Select all
# as root
cd "/Library/Application Support/Perceptive Automation"
chown -R indigo:indigo "Indigo 4"
Now we'll have to arrange for the Indigo server to get started as a daemon. Put the following file into /Library/LaunchDaemons/com.perceptiveautomation.IndigoServer2.plist, again as root):
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UserName</key>
<string>indigo</string>
<key>GroupName</key>
<string>indigo</string>
<key>Label</key>
<string>com.perceptiveautomation.IndigoServer2</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Application Support/Perceptive Automation/Indigo 4/IndigoServer.app/Contents/MacOS/IndigoServer</string>
</array>
</dict>
</plist>
If you changed anything (like the name of the user), edit the file to match.
Then run
- Code: Select all
launchctl load /Library/LaunchDaemons/com.perceptiveautomation.IndigoServer2.plist
The server should start up (and stay up). There will be an error message in the system log about inability to talk to the window server; ignore that. The server runs as the user "indigo" (or whatever you called it); if it needs access to something (say, a device), make sure it can. Don't let "indigo" access anything else on your computer, for security's sake.
And that's basically it. Launch the Indigo client and ask to connect to "remote" host localhost (127.0.0.1); the client will open up, and you can work with Indigo as usual. Of course, you can also connect from other computers (if you allowed that). Note that everything you do in the UI is now "remote", so none of the "local only" operations (such as "open log folder") will work. If you let the indigo user log in, you can do local administration that way. (I don't.)
What else doesn't work? AppleScripts that want to put up windows won't work, of course - the server is a daemon, after all. More insidiously, some AppleScript actions that don't obviously do graphics are wobbly; for example, I've found that the "say" command actually speaks the words but then returns an error (so the script stops). Experiment; in the case of "say", just wrap a try block around it and ignore the error. Scripting Indigo itself seems to work (so far).
If you need to do something that requires a combined server to run (e.g. upgrading Indigo), first shut down the server:
- Code: Select all
launchctl unload -w /Library/LaunchDaemons/com.perceptiveautomation.IndigoServer2.plist
Then do your upgrade, launch Indigo in combined mode, let it upgrade the database, save the new copy, quit Indigo, and run the "chown" command above again to make sure the indigo user owns everything. Then turn the server back on:
- Code: Select all
launchctl load -w /Library/LaunchDaemons/com.perceptiveautomation.IndigoServer2.plist
Should the Indigo server crash for some reason, launchd will automatically relaunch it. This also applies if you are telling it to shut down, so don't do that - use the "launchctl unload" command instead.
Let me say in passing that Indigo's architecture seems really well done; the server/client separation works and makes this kind of thing possible. It certainly blows the doors off the usual monolithic applications, who need to bring up all their UI bits just to run as servers, with all the instability that can entail.
Questions? Just ask...
Cheers
-- perry
admin edit: changed Indigo 2 folder path to Indigo 4.