![rc-local.service:失败,结果为“退出代码”](https://linux22.com/image/952272/rc-local.service%EF%BC%9A%E5%A4%B1%E8%B4%A5%EF%BC%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%E2%80%9C%E9%80%80%E5%87%BA%E4%BB%A3%E7%A0%81%E2%80%9D.png)
我想在我的 VPS 服务器中激活 UDPGW 端口以进行通话和游戏,我对之前的两个 VPS 执行了此命令,并且运行良好。
sudo wget -O /usr/bin/badvpn-udpgw "https://raw.githubusercontent.com/daybreakersx/premscript/master/badvpn-udpgw64"
sudo touch /etc/rc.local
sudo nano /etc/rc.local
----------------------
#!/bin/sh -e
screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300
exit 0
----------------------
chmod +x /etc/rc.local
sudo systemctl status rc-local.service
sudo chmod +x /usr/bin/badvpn-udpgw
sudo screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300
reboot
sudo lsof -i -P -n | grep LISTEN
但现在在我的第三个 VPS 中这样说:
systemd[1]: Starting /etc/rc.local Compatibility...
rc.local[458]: /etc/rc.local: 2: screen: not found
systemd[1]: rc-local.service: Control process exited, code=exited, status=127/n/a
systemd[1]: rc-local.service: Failed with result 'exit-code'.
systemd[1]: Failed to start /etc/rc.local Compatibility.
有什么问题?我该如何解决?我正在使用 Ubuntu 20.04
更新:当我使用时sudo systemctl status rc-local.service
显示这个:
* rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
Drop-In: /usr/lib/systemd/system/rc-local.service.d
`-debian.conf
Active: failed (Result: exit-code) since Sat 2023-05-27 10:40:31 EEST; 5 days ago
Docs: man:systemd-rc-local-generator(8)