linux 开机启动 .sh 文件

1
2
3
4
检查 .sh 文件中是否含有  
    #chkconfig: 2345 80 90
    #description:auto_run
如果没有的话,加入。

  

1
2
3
4
5
6
7
8
#将该文件移动到 /etc/init.d
cp  ***.sh  /etc/init.d
 
#添加为服务,并设置开机启动
chkconfig --add ***.sh
chkconfig --list                             # 检查一下是否加入了 start_for_cdn_node.sh
chkconfig ****.sh on           # (开机自启动)
service *****.sh start          # (启动服务)

  

本文参考:https://www.jianshu.com/p/eb3ce5117ece

posted @   自己的太阳  阅读(6182)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示