注意:CentOS 6下基本没什么问题,CentOS 7估计不一定能行. 在CentOS系统下,主要有两种方法设置自己安装的程序开机启动. 1.把启动程序的命令添加到/etc/rc.d/rc.local文件中,比如下面的是设置开机启动httpd. #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in
在linux下想实现开机启动的方法很多,这里我采用了在/etc/rc.local里写shell指令的方式. 以下就以我的实际操作为例子讲述,很多地方需要看官自己调整信息哦! 1.在/etc/rc.local文件中,添加你想要执行的脚本. 比如,我现在要执行的是Golang项目启动的脚本: ficowLogPath="/home/ficow/autoLaunchLog.txt" #launch ficow's blog server cd /home/ficow/ficowblog/sr