- 给rc.local 添加可执行权限
sudo chmod +x /etc/rc.d/rc.local
- rc-local.service增加 install 节点配置
sudo vi /usr/lib/systemd/system/rc-local.service
在文件中添加以下内容
[Install]
WantedBy=multi-user.target
- 启动rc-local服务
systemctl start rc-local
- 设置rc-local服务开机自启动
systemctl enable rc-local
- 查看rc-local服务状态
systemctl status rc-local
标签:service,Linux,sudo,systemctl,rc,开机,local
From: https://www.cnblogs.com/Denny_Yang/p/17325063.html