tags:

views:

27

answers:

1

Hello Everyone!

Please save me from a potential nervous breakdown!

I've been following Apples documentation (see below) on how to create a Startup Item. Currently I'm just trying to get my script to print something to the console, much less actually run my app.

Here are my two scripts, one is the startup executable, the other is the plist:

#!/bin/sh
. /etc/rc.common

# The start subroutine
StartService() {
# Insert your start command below.  For example:
echo "hey Eric we've started" 
# End example. 
  }

# The stop subroutine
 StopService() {
# Insert your stop command(s) below.  For example:

  echo "STOPPED ERIC"

# End example.
    }

   # The restart subroutine
     RestartService() {
    # Insert your start command below.  For example:

echo "RESTART ERIC"


    # End example.
       }

 RunService "$1"






 {
 Description     = "Software Update service";
   Provides        = ("SoftwareUpdateServer");
  Requires        = ("Network");
   Uses            = ("Network");
   OrderPreference = "Late";
    Messages =
   {
     start = "Starting Software Update service";
     stop  = "Stopping Software Update service";
     };
  }

Using terminal I tried to set the permissions as closely as possible as to how it is documented in the example in the link below. The odd thing was that the files didn't show the 'root' aspect to their ownership.

I then ran SystemStarter start theApp and nothing happens. Absolutely nothing.

Any help?

http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html

+1  A: 

You should not create a Startup Item any more. It's a legacy mechanism and superseded by launchd. Write a plist for launchd instead. I know this is not the help you wanted, but sadly with Apple, you need to follow the mothership...

Read this section of the same document instead.

See the document just you quoted yourself:

Note: The launchd facility is he preferred mechanism for launching daemons in Mac OS X v10.4 and higher. Unless your software requires compatibility with Mac OS X v10.3 or earlier, you should use the launchd facility instead of writing a startup item. For more information, see “Guidelines for Creating and Launching Daemons.”

Note that v10.4 become available in 2005.

Yuji
@Yuji,Hello.Thanks for getting back to me. You were totally right, launchd is the way to go.I found this website on how to create one which was pretty useful, but not complete. For my purposes (which were to run an executable at start time) in addition to the plist parameters they have indicated, you also need a:RunAtLoad Boolean that is toggled on. For those interested, here is the websitehttp://www.macgeekery.com/tips/all_about_launchd_items_and_how_to_make_one_yourselfThanks again,Eric
Eric Brotto