I have a go project and when I compile it I get your typical binary. If I call the binary directly from the command line with the adequate inputs, it runs perfectly well. I want to make this program part of the systemd ecosystem though and the following is my binary.service
[Unit]
Description=Run Go Service
[Service]
WorkingDirectory=/path/to/directory/
ExecStart=/path/to/directory/binary --config /full/path/to/service.conf
Restart=always
[Install]
WantedBy=multi-user.target
I can start and stop the service using the usual call sudo service application start. I don't receive any error messages but when I check journalctl -xe it says the start failed but it gives no details as to why. If I run the exact same command through the command line and not through systemd, the application runs just fine. How do I troubleshoot this?
servicecommand isinitdcomponent. Try start service assystemctl start applicationandsystemctl status applicationafter it. – Yurij Goncharuk Mar 25 '18 at 20:15Type=parameter in the unit file. – Multisync Mar 25 '18 at 20:24Type=simple(which is also the default if you don't add a type) but it doesn't make a difference. – Mnemosyne Mar 25 '18 at 20:36Type=. By default it hassimplevalue and starts service fromExecStartfield value. "No need" - I mean case from question. – Yurij Goncharuk Mar 25 '18 at 20:36journalctlandsystemctl statusin fact do give details of what is going on, and this information needs to be [edit]ed into your question. – JdeBP Mar 25 '18 at 22:46