Systemd nats.service 文件抛出错误

Systemd nats.service 文件抛出错误

我安装 NATS 作为 Ubuntu 的引导。如何在 Ubuntu 16.04 上安装和配置 NATS

我在 Fedora 27 中使用了与此相同的指令,它正在工作。

但 nats.service 文件在 Fedora 29 中不起作用

/etc/systemd/system/nats.service

[Unit]
Description=NATS messaging server

[Service]
ExecStart=/srv/nats/bin/gnatsd -c /srv/nats/gnatsd.config
User=nats
Restart=on-failure

[Install]
WantedBy=multi-user.target

我做了sudo systemctl start nats并且sudo systemctl status nats

它正在显示

● nats.service - NATS messaging server
   Loaded: loaded (/etc/systemd/system/nats.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-02-17 16:28:54 +0530; 1s ago
  Process: 6664 ExecStart=/srv/nats/bin/gnatsd -c /srv/nats/gnatsd.config (code=exited, status=203/EXEC)
 Main PID: 6664 (code=exited, status=203/EXEC)

Feb 17 16:28:54 localhost.localdomain systemd[1]: nats.service: Service RestartSec=100ms expired, scheduling restart.
Feb 17 16:28:54 localhost.localdomain systemd[1]: nats.service: Scheduled restart job, restart counter is at 5.
Feb 17 16:28:54 localhost.localdomain systemd[1]: Stopped NATS messaging server.
Feb 17 16:28:54 localhost.localdomain systemd[1]: nats.service: Start request repeated too quickly.
Feb 17 16:28:54 localhost.localdomain systemd[1]: nats.service: Failed with result 'exit-code'.
Feb 17 16:28:54 localhost.localdomain systemd[1]: Failed to start NATS messaging server.

/srv/nats/bin/gnatsd -c /srv/nats/gnatsd.config工作正常。

相关内容