systemctl 不适用于自己的守护进程

systemctl 不适用于自己的守护进程

systemctl我在使用in启动自己的守护程序时遇到问题德班(如果这有任何意义,守护进程已在 golang 中写入)

我在 中创建了文件/etc/systemd/system/tcp-server.service。他的内容如下

[Service]
ExecStart=/home/guestiodeb/app/guestio-tcp-server/guestio-tcp-server
WorkingDirectory=/home/guestiodeb/app/guestio-tcp-server
Restart=always
User=guestiodeb
Group=guestiodeb

[Install]
WantedBy=multi-user.target

接下来我尝试启用并启动我的服务

# systemctl enable tcp-server.service
# systemctl start tcp-server.service

守护进程尚未运行。我已检查状态服务并获取数据

#systemctl status tcp-server.service
tcp-server.service
   Loaded: loaded (/etc/systemd/system/tcp-server.service; enabled)
   Active: failed (Result: start-limit) since Mon 2016-01-04 18:18:49 EST; 1min 13s ago
  Process: 29327 ExecStart=/home/guestiodeb/app/guestio-tcp-server/guestio-tcp-server (code=exited, status=1/FAILURE)
 Main PID: 29327 (code=exited, status=1/FAILURE)

Jan 04 18:18:49 guestIO systemd[1]: tcp-server.service: main process exited, code=exited, status=1/FAILURE
Jan 04 18:18:49 guestIO systemd[1]: Unit tcp-server.service entered failed state.
Jan 04 18:18:49 guestIO systemd[1]: tcp-server.service start request repeated too quickly, refusing to start.
Jan 04 18:18:49 guestIO systemd[1]: Failed to start tcp-server.service.
Jan 04 18:18:49 guestIO systemd[1]: Unit tcp-server.service entered failed state.

哪里有问题?

PS

我想补充一点,我还有其他自己的守护进程,我以与上面相同的方式运行他,一切正常。我不知道为什么对于这个非常相似的程序,这种同样的方式不起作用。

相关内容