M
M
ML2017-06-17 14:46:24
go
ML, 2017-06-17 14:46:24

How to set up systemd for go applications?

How to set up systemd for go applications?
in fact there is - "/root/work/src/app/project" is the go directory of the project. There is a binary
"project" obtained via go build. I know that I can run it all like this:

$ cd /root/work/src/app/project
$ /root/work/src/app/project project

But in this case, the console will monitor go applications. And if I close the console or exit (ctrl+c). The project will stop working.
Here's how to do everything with systemd?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-06-17
@RidgeA

You need to make a systemd unit-file, where you specify the binary as the executable file.
How to make a unit-file - google it.
If you just need to run a task in the background so that it does something - there is a screen, you can just run it in the background.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question