Centos7如何设置脚本开机自启动?

时间:2020-01-31 22:53:02   收藏:0   阅读:86

1. 在需要设置为开机启动的脚本中加入必须的chkconfig启动脚本规范,如下:

#!/bin/bash
# chkconfig:   2345 80 12
# description:  auto start shell script

2. 使用chkconfig将脚本加入自动启动列表

# mv your.sh /etc/rc.d/init.d

# chkconfig /etc/rc.d/init.d/your.sh

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!