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

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

posted @ 2020-01-31 21:23  Jello  阅读(1043)  评论(0编辑  收藏  举报