0

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.

3
  • The problem is that your program is exiting with exit code 1. What happens when you run it outside of systemd?
    – jordanm
    Jan 4, 2016 at 17:47
  • I run program just as user $/home/guestiodeb/app/guestio-tcp-server/guestio-tcp-server & and works.
    – Mbded
    Jan 4, 2016 at 18:00
  • I have a solution. My program have a variable as path to configuration file. If I run this program as simply user path was be correct, but if I have tryed run program as sudo path to configuration file should be as path absolute.
    – Mbded
    Jan 4, 2016 at 19:50

0

You must log in to answer this question.

Browse other questions tagged .