Mac OS x startup Item Settings
How Mac OS X starts:
1,mac firmware activated, initialize hardware, load bootx bootloader.
2,bootx load kernel and kernel extension (kext).
3, the kernel starts the launchd process.
4,launchd according to /system/library/launchagents,/system/library/launchdaemons,/library/launchdaemons,/ Library/launchagents, ~/library/launchagents in the plist configuration, start the service daemon.
In Mac OS X , there are three ways to implement the configuration of a startup item:
- Login Items;2)startupitems;3)launchd daemon
1.Login Items
Open System Preferences, select System-Accounts, select the Login Items tab, and the /applications directory the. App is dragged directly into the list on the right. After you restart your computer, you will see that the program on the list starts automatically after it is powered on.
2.StartupItems
Definition:startupitems: A program that runs during system startup, which can be a program that terminates immediately after running (for example, emptying the trash on the boot), or a background process that has been running for the duration of the system.
Path:
1)/system/library/startupitems
2)/library/startupitems
Most of the system-related startupitems are placed under the/system/library/startupitems path, which is preceded by /library/startupitems path execution, because the Startupitems in the former path provides a system-level base service, such as crash reporting,core graphics services ,system accounting, and so on, while the latter path does not exist by default, it needs to be created manually.
For example: Here we take the icebergcontroltower of the/library/startupitems directory as an example.
In a nutshell, on Mac OS X , a startupitems contains the following two things:
1) enforceable procedures;
- A plist file (startupparameters.plist) that contains dependent process relationships.
For example:
Startupparameters.plist is a list of attributes that contain the necessary conditions for running an executable program.
Create a startupparameters.plist file
The executable File is created:
Note:1) The name of the executable file is the same as the filename of the folder in whichit resides, which is the default rule for the system.
2) root permission is required to operate the executable file .
3) The executable file is a shell script.
Open The icebergcontroltower file directory under the same name executable file, you can see the specific contents of the script:
3. Launchd Daemon
Launchd is a critical process for initializing the system environment under MAC OS, which is the first process that starts in the OS environment after the kernel is loaded successfully .
Configuration file path: Create plist under ~/library/launchagents path
For example : the plist file format and the meaning of each field:
Create a plist file:
In Mac OS x, there are three ways to implement the configuration of a startup item