本文基于Mac OS X Lion.

编辑文件/etc/rc.common

View Code BASH

1 sudo vim /etc/rc.common

尾部添加内容:

View Code BASH

1 2 3 if [ -f /etc/rc.local ]; then     sh /etc/rc.local fi

创建文件/etc/rc.local

View Code BASH

1 sudo touch /etc/rc.local

然后就可以像Linux一样使用/etc/rc.local了。

/etc/rc.local示例:

View Code SH

1 2 3 4 5 6 7 8 9 10 11 12 13 ############################ # rc.local ############################ # # Gearmand Server #

/usr/local/sbin/gearmand -d -u root

# # Nginx Web Server #

/usr/local/bin/nginx

Comments are closed.

Post Navigation