ubuntu16.04
vim /etc/rc.local
ubuntu18.04
1、vim /etc/rc.local
#!/bin/sh -e
exit 0
2、sudo chmod 755 /etc/rc.local
3、vim /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
elias=rc-local.service
4、sudo chmod 755 /etc/systemd/system/rc-local.service
5、sudo systemctl daemon-reload
6、sudo systemctl enable rc-local.service
本文介绍了如何在从Ubuntu16.04升级到18.04的过程中,更新rc.local脚本并将其整合到systemd服务中,包括使用vim编辑文件、改变权限和系统管理命令的操作。

1万+

被折叠的 条评论
为什么被折叠?



