Systemd 服务:无法发出方法调用:单元服务失败

Systemd 服务:无法发出方法调用:单元服务失败

我正在尝试在我的 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

我也重新启动了服务器,但什么也没有,任何人都可以给我一些发生了什么事的提示吗?

相关内容