linux添加开机启动项
1.修改 /etc/rc.local文件
#vim /etc/rc.local
追加启动内容,例如开机启动nginx(编译安装nginx)
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
2.或者使用chkconfig
chkconfig --level 345 nfs off
3.自己写shell脚本
将写好的脚本(.sh文件)放到目录php /etc/profile.d/
下,系统启动后就会自动执行该目录下的所有shell脚本
4.如何把服务加入chkconfig中
参考以下链接:
http://lihuipeng007.blog.163.com/blog/static/1210843882010912111320159/
转载请注明出处72智客