Automatically starting Indigo

Posted on
Thu Jan 03, 2008 10:19 pm
Btwyx offline
Posts: 30
Joined: Jan 03, 2008
Location: Mountain View, CA

Automatically starting Indigo

I've seen a few people here wanting to have the Indigo server startup automatically. I want that as well, Indigo is running on my server tucked away in the spare room. Servers should always auto start, so I was surprised this didn't seem to be an option. So I made a startup item myself. Apple's documentation on how to do this is here.

So now everytime the server restarts, the Indigo server is stated automatically in the background. This happens even if no one logs in.

To do this you have to have root access to the machine, and be relatively familiar with the terminal. Basically the system looks for directories in /Library/StartupItems/ and tries to execute the scripts in them

The one I made looks like this:

Here's the files/directories needed, the permissions are important here.
Code: Select all
root# ls -lR /Library/StartupItems/
total 0
drwxr-xr-x  5 root  wheel  170 Dec 25 22:44 IndigoServer

/Library/StartupItems//IndigoServer:
total 16
-r-xr-xr-x  1 root  wheel  121 Dec 25 22:44 IndigoServer
-rw-r--r--  1 root  wheel  905 Dec 25 22:29 StartupParameters.plist
drwxr-xr-x  2 root  wheel   68 Dec 25 22:31 resources

/Library/StartupItems//IndigoServer/resources:

I'm not sure if the resources directory is actually needed, but my example has one, even though its empty.

The script which launches the server is this:
Code: Select all
root# cat IndigoServer
#!/bin/sh

/Library/Application\ Support/Perceptive\ Automation/Indigo\ 2/IndigoServer.app/Contents/MacOS/IndigoServer&

The system also needs a file to tell it to execute that:
Code: Select all
root# cat StartupParameters.plist
<xml>
<DOCTYPE>
<plist>
<dict>
        <key>Description</key>
        <string>IndigoServer</string>
        <key>Messages</key>
        <dict>
                <key>start</key>
                <string>Starting IndigoServer</string>
                <key>stop</key>
                <string>Stopping IndigoServer</string>
        </dict>
        <key>OrderPreference</key>
        <string>Last</string>
        <key>Provides</key>
        <array>
                <string>IndigoServer</string>
        </array>
        <key>Requires</key>
        <array>
                <string>Network</string>
                <string>Network Configuration</string>
        </array>
        <key>Uses</key>
        <array>
                <string>DirectoryServices</string>
        </array>
</dict>
</plist>

Posted on
Thu Jan 03, 2008 10:41 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Automatically starting Indigo

Actually, Indigo does have an option to automatically launch on user login. That is available via the Start Local Server... dialog (from the Indigo 2 menu). It installs a launchd LaunchAgent .plist if you select that option and will automatically launch on user login.

There is another thread here that talks about running IndigoServer as a true daemon before any user is logged in.

It sounds like you have had luck getting it running via the StartupItems folder, although Apple is now recommending the use of launchd (LaunchAgents and LaunchDaemons) over StartupItems.

Tiger and older versions of OS X have a further limitation that prevents applications from running that require the WindowServer process. Unfortunately, AppleScript requires that process, so when the IndigoServer is passed the -daemon flag it disables all AppleScript functionality so that IndigoServer can launch successfully.

However, I believe that limitation may not exist in Leopard. So it might be possible to start the IndigoServer via a LaunchDaemon .plist and not have to pass it the -daemon flag anymore. I haven't tried it yet, but based on your experience getting it working with StartupItems, I believe they must have removed that limitation in Leopard.

Matt

Posted on
Fri Jan 04, 2008 12:19 am
Btwyx offline
Posts: 30
Joined: Jan 03, 2008
Location: Mountain View, CA

Re: Automatically starting Indigo

support wrote:
It sounds like you have had luck getting it running via the StartupItems folder, although Apple is now recommending the use of launchd (LaunchAgents and LaunchDaemons) over StartupItems.
StartupItems was the way to it last time I needed to do this, which was around Jaguar. I haven't kept up with any recommendations Apple has made in the meantime.

I don't use any AppleScripts, yet. I may find out if this does work under Leopard, there are some things I think I need to do with AppleScript. I'm running this on Leopard Server.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests