![Systemd 服务:无法发出方法调用:单元服务失败](https://linux22.com/image/104773/Systemd%20%E6%9C%8D%E5%8A%A1%EF%BC%9A%E6%97%A0%E6%B3%95%E5%8F%91%E5%87%BA%E6%96%B9%E6%B3%95%E8%B0%83%E7%94%A8%EF%BC%9A%E5%8D%95%E5%85%83%E6%9C%8D%E5%8A%A1%E5%A4%B1%E8%B4%A5.png)
我正在尝试在我的 VPS 中提供定制服务。但是,它不允许我运行它。它说如下。我不确定发生了什么,但是当我在我的 Ubuntu 笔记本电脑上运行它时,它工作正常。可能是什么问题呢?
sudo systemctl 启动 websocket.service
Failed to issue method call: Unit websocket.service failed to load: No such file or directory. See system logs and 'systemctl status websocket.service' for details.
猫 /lib/systemd/system/websocket.service
[Unit]
Description=php webSocket
After=syslog.target network.target
[Service]
User=root
Type=simple
ExecStart=/webs.sh
TimeoutStopSec=20
KillMode=process
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
Alias=websocket.service
猫/webs.sh
#!/usr/bin/php /server.php
### BEGIN INIT INFO
# Provides: webSocket
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: php webSocket
# Description: php webSocket
### END INIT INFO
我已经尝试过systemctl daemon-reload
,但我得到以下信息:
Attempted to remove disk file system, and we can't allow that.
Ignoring /etc/systemd/system/multi-user.target.wants/ssh.service -> /lib/systemd/system/ssh.service for systemd deputy init
Ignoring /etc/systemd/system/multi-user.target.wants/rsyslog.service -> /lib/systemd/system/rsyslog.service for systemd deputy init
Ignoring /etc/systemd/system/multi-user.target.wants/bind9.service -> /lib/systemd/system/bind9.service for systemd deputy init
Ignoring /etc/systemd/system/timers.target.wants/phpsessionclean.timer -> /lib/systemd/system/phpsessionclean.timer for systemd deputy init
我也重新启动了服务器,但什么也没有,任何人都可以给我一些发生了什么事的提示吗?