MAC system startup process
See:
Http://hi.baidu.com/%CB%E6%B7%E7%B6%F8%D0%D01999/blog/item/271d20a694d7d49dd0435842.html
1 MAC boot STARTUP script or application (run shell script when the system starts)
1) if you want to start a Mac application (XXX. APP), you can set it on a graphical interface:
System prefernce --> accounts --> logitems --> Add
2) Place the shell or application to the/labrary/startupitems/directory.
3) Create the/etc/rc. Local file and write the script in the file.
4) if you only start the shell program, there is another way, the general process is like this.
A) Set terminate to start at startup. In this way, the shell can be automatically run when the system starts.
B) create or modify ". Profile" in the user directory ". When the shell is started, run the ". Profile" file first.
C) Call the shell script to be executed in ". Profile ".
5) apply Mac launchd, see: http://cb.esast.com/cb/wiki/10020
Apple's security check: when using the method 2 and 3 mentioned above, you must set the user ID and group ID of the file, as well as the running permission of the file. The specific method is described below.
After the configuration is complete, you can use systemstarter on the terminal to debug the configuration information.
Command: systemstarter-n-d
You can view the configuration issues as prompted.
2. Solve the "insecure startup Item disabled. error"
You can put the shell to be started in the/labrary/startupitems/directory.
You must change the user ID and group ID of the file and set the permission to 755.
Sudo chown-r root: wheel/library/startupitems/xxx
Sudo chmod-r 755/library/startupitems/xxx
(If you are running a shell file, you do not need to add the-r option to the command)
Note: Environment Variable issues.
Of course, you must refer to Apple's developer documentation:
Introduction to System Startup Programming Topics
Http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html#//apple_ref/doc/uid/10000172-SW1
MAC system startup process
See:
Http://hi.baidu.com/%CB%E6%B7%E7%B6%F8%D0%D01999/blog/item/271d20a694d7d49dd0435842.html
1 MAC boot STARTUP script or application (run shell script when the system starts)
1) if you want to start a Mac application (XXX. APP), you can set it on a graphical interface:
System prefernce --> accounts --> logitems --> Add
2) Place the shell or application to the/labrary/startupitems/directory.
3) Create the/etc/rc. Local file and write the script in the file.
4) if you only start the shell program, there is another way, the general process is like this.
A) Set terminate to start at startup. In this way, the shell can be automatically run when the system starts.
B) create or modify ". Profile" in the user directory ". When the shell is started, run the ". Profile" file first.
C) Call the shell script to be executed in ". Profile ".
5) apply Mac launchd, see: http://cb.esast.com/cb/wiki/10020
Apple's security check: when using the method 2 and 3 mentioned above, you must set the user ID and group ID of the file, as well as the running permission of the file. The specific method is described below.
After the configuration is complete, you can use systemstarter on the terminal to debug the configuration information.
Command: systemstarter-n-d
You can view the configuration issues as prompted.
2. Solve the "insecure startup Item disabled. error"
You can put the shell to be started in the/labrary/startupitems/directory.
You must change the user ID and group ID of the file and set the permission to 755.
Sudo chown-r root: wheel/library/startupitems/xxx
Sudo chmod-r 755/library/startupitems/xxx
(If you are running a shell file, you do not need to add the-r option to the command)
Note: Environment Variable issues.
Of course, you must refer to Apple's developer documentation:
Introduction to System Startup Programming Topics
Http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html#//apple_ref/doc/uid/10000172-SW1