/lib/systemd/system/rc-local.service.d/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=infinity
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
chmod +x /lib/systemd/system/rc-local.service.d/rc-local.service
ln -s /lib/systemd/system/rc-local.service.d/rc-local.service /etc/systemd/system/
/etc/rc.local
#!/bin/sh
exit 0
可执行权限
chmod +x /etc/rc.local