• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: recommended way to install something into /Library/StartupItems?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recommended way to install something into /Library/StartupItems?


  • Subject: Re: recommended way to install something into /Library/StartupItems?
  • From: Joshua Levitsky <email@hidden>
  • Date: Thu, 15 Feb 2007 12:55:56 -0500


On Feb 15, 2007, at 12:31 PM, Benjamin Lam wrote:

What is the recommended way to install something into /Library/StartupItems? I need to put some items in there, can I just create the Library/StartupItems structure with the items when I create the package or should I copy the items in during postflight?

If I just create the package with the Library/StartupItems structure and if other software puts items in there, then my package runs, it won’t ‘reset’ the Library/StartupItems folder will it, deleting the other items (to match the given structure in my package) will it?


That folder is just a folder... so you can drop a folder in there called "MyItem" or whatever you want and then put the plist and binary or script in there and it will run. Just make sure you use the right permissions as Tiger is strict about permissions or you get an error on next reboot saying it needs to fix the permissions. You can either copy it in with a preflight or you can write it directly in the PKG. It's honestly whichever way you want.

Here is a script I added and the permissions for it. Below that is the startupparameters.plist file contents for my particular item. The only problem you could run in to is that you call your item the same thing as someone elses and you stomp on them so try to be unique about the name you use. 

#ls -ld /Library/StartupItems/MTU/
drwxr-xr-x   4 root  wheel  136 Nov  7 09:53 /Library/StartupItems/MTU/

#ls -l /Library/StartupItems/MTU/
total 16
-rwxr-xr-x   1 root  wheel  637 Nov  7 09:50 MTU
-rwxr-xr-x   1 root  wheel  544 Sep 13  2005 StartupParameters.plist


---- StartupParameters.plist -----

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Description</key>
        <string>Can set MTU</string>
        <key>OrderPreference</key>
        <string>None</string>
        <key>Provides</key>
        <array>
                <string>MTU</string>
        </array>
        <key>Requires</key>
        <array>
                <string>Network Configuration</string>
        </array>
</dict>
</plist>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >recommended way to install something into /Library/StartupItems? (From: "Benjamin Lam" <email@hidden>)

  • Prev by Date: recommended way to install something into /Library/StartupItems?
  • Next by Date: RE: recommended way to install something into
  • Previous by thread: recommended way to install something into /Library/StartupItems?
  • Next by thread: Re: recommended way to install something into /Library/StartupItems?
  • Index(es):
    • Date
    • Thread