为什么这个 systemd 服务失败了?

为什么这个 systemd 服务失败了?

我在用着Ubuntu 18.04 服务器我创建了名为 systemd 的文件socket-io.service像这样的位置

创建 Systemd 服务

vim /etc/systemd/system/socket-io.service


[Unit]
Description=Sellist Notification Service
After=network.target

[Service]
User=minion
Group=minion
Restart=always
ExecStart=/usr/bin/node /var/www/socket.io/server.js

[Install]
WantedBy=default.target

然后启用并启动服务

systemctl enable socket-io && systemctl start socket-io

但结果——启动失败

root@ubuntu:/etc/systemd/system# systemctl status socket-io
● socket-io.service - Sellist Notification Service
   Loaded: loaded (/etc/systemd/system/socket-io.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-12-19 08:00:45 UTC; 3 days ago
 Main PID: 4356 (code=exited, status=217/USER)

Dec 19 08:00:44 ubuntu systemd[1]: socket-io.service: Main process exited, code=exited, status=217/USER
Dec 19 08:00:44 ubuntu systemd[1]: socket-io.service: Failed with result 'exit-code'.
Dec 19 08:00:45 ubuntu systemd[1]: socket-io.service: Service hold-off time over, scheduling restart.
Dec 19 08:00:45 ubuntu systemd[1]: socket-io.service: Scheduled restart job, restart counter is at 5.
Dec 19 08:00:45 ubuntu systemd[1]: Stopped Sellist Notification Service.
Dec 19 08:00:45 ubuntu systemd[1]: socket-io.service: Start request repeated too quickly.
Dec 19 08:00:45 ubuntu systemd[1]: socket-io.service: Failed with result 'exit-code'.
Dec 19 08:00:45 ubuntu systemd[1]: Failed to start Sellist Notification Service.

我尝试创建一些其他 Systemd 服务(例如 Laravel 队列),但最终还是以失败状态结束。请帮我解决这个问题,在此先谢谢了。

相关内容