从CentOS7.0开始,/etc/rc.d/rc.local文件的初始权限变成了644,并且rc-local.service服务的状态是disabled状态。
1、增加权限:
chmod +x /etc/rc.local
2、检查/etc/rc.local增加:#!/bin/bash
3、 systemctl list-units --type=service
4、systemctl status rc-local.service
5、systemctl enable rc-local.service
6、systemctl start rc-local.service