rc-local.service:失败,结果为“退出代码”

rc-local.service:失败,结果为“退出代码”

我想在我的 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)

相关内容