![]() In OS X v10.4 and later, most low-level services are started with launchd. The values of the Requires and Uses keys do not guarantee a particular launch order. If the name of only one of the services matches the name of another service, the entire startup item might not be executed and neither service would be launched. This is one of the reasons why your own startup items should launch only one service. If two startup items provide a service with the same name, the system runs only the first startup item it finds with that name. For example, if the startup item launches multiple services, only one of those services can have the same name as the startup item. The Provides property specifies the actual name of the service provided by a startup item, and while this name usually matches the name of the startup item, it is not required to do so. The service names you specify in the Requires and Uses arrays may not always correspond directly to the name of the startup item that provides that service. Your startup item script should execute as quickly as possible and then exit.įor more information about writing shell scripts, see Shell Scripting Primer. Performing lengthy startup tasks directly from your scripts delays system startup. If your startup-item executable contains code that might take a long time to finish, consider spawning off a background process to run that code. You must provide implementations for all three routines, although the implementations can be empty for routines whose commands your service does not support. The RunService routine looks for StartService, StopService, and RestartService functions in your shell script and calls them to start, stop, or restart your services as needed. For more information, see Startup Item Permissions. Your installer script should set the permissions of the startup item directory to prevent non-root users from modifying the startup item or its contents. ![]() (Your installer may need to create this directory first.) Įxample: MyDBServer/istĬreate an installer to place your startup item in the /Library/StartupItems directory of the target system. For information on the keys to include in this property list, see Specifying the Startup Item Properties. For more information, see Creating the Startup Item Executable.Ĭreate a property list with the name ist and add it to the directory. The name of your executable should be exactly the same as the directory name. The directory name should correspond to the behavior you’re providing.Īdd your executable to the directory. Depending on your needs, you may also include other files in your startup item bundle directory.Ĭreate the startup item directory. The name of the configuration property list is always ist. The name of the startup item executable must match the name of the startup item itself. A startup item is a directory whose executable and configuration property list reside in the top-level directory. Unlike many other bundled structures, a startup item does not appear as an opaque file in the Finder. Note that this directory does not exist by default and may need to be created during installation of the startup item. All other startup items should be placed in the /Library/StartupItems directory. The /System/Library/StartupItems directory is reserved for startup items that ship with OS X. The startup item typically contains a shell script or other executable file along with configuration information used by the system to determine the execution order for all startup items. For more information, see Creating Launch Daemons and Agents.Ī startup item is a specialized bundle whose code is executed during the final phase of the boot process, and at other predetermined times (see Managing Startup Items). Unless your software requires compatibility with OS X v10.3 or earlier, use the launchd facility instead. ![]() Launching of daemons through this process may be removed or eliminated in a future release of OS X. Deprecation Note: Startup items are a deprecated technology. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |