I have a problem with starting own daemon program using systemctl
in Debian (deamon has wirted in golang if this have any meaning)
I created file in /etc/systemd/system/tcp-server.service
. His content below
[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
And next I have tryed enable and start my service
# systemctl enable tcp-server.service
# systemctl start tcp-server.service
Daemon has not run. I have checked status service, and get data
#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.
Where is a problem ?
Ps
I want to add that, I have also other own daemon, and I runing him in this same way as above and everything works good. I don't have idea why for this very similar program, this same way not works.
$/home/guestiodeb/app/guestio-tcp-server/guestio-tcp-server &
and works.sudo
path to configuration file should be as path absolute.