MAC system startup process and run shell script at system startup

Source: Internet
Author: User
Tags documentation

The startup process of the MAC system

can see:

Http://hi.baidu.com/%CB%E6%B7%E7%B6%F8%D0%D01999/blog/item/271d20a694d7d49dd0435842.html

1 Mac boot up script or application (run shell script at system startup)

1 if you want to start a Mac application (that is, Xxx.app), you can set it through a graphical interface:

System Prefernce-->accounts-->logitems-->add

2 Put the shell or application you want to start into 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 the Terminate to boot. This allows the shell to run automatically when the system is started.

(B) Create or modify ". Profile" in the user directory. When the shell starts, run the. Profile file First

(C) Call the shell script that you want to execute in ". Profile"

5 Application of Mac Launchd, see also: http://cb.esast.com/cb/wiki/10020

Apple's security check: With the 2,3 method described above, you must set the file's user ID and group ID, as well as the file's run permissions. The specific methods are described below.

When Setup is complete, you can use Systemstarter to debug configuration information on the terminal

Command is: systemstarter-n-D

Depending on the information you are prompted, you can view configuration issues.

2 Solve "insecure Startup Item disabled. Error"

You can put the shell you want to start in the/labrary/startupitems/directory.

You must change the user ID and group ID of the file, and the permission is 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 the-r option in the command)

Note: Environment variable problem.

Of course, make sure to 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.