0

I have a golang application that needs to run as a service on Ubuntu.

My users are not developers so I need to make this process as turn-key as possible. I was thinking the best way would be to package the binary into a PPA and then my users could use apt-get to install and update:

sudo add-apt-repository...
sudo apt-get update
sudo apt-get install...

For running as a service systemd obviously comes to mind first and that part to me makes sense; however, what I can't figure out is how to go from sudo apt-get to running as a service.

Perhaps I'm approaching this all wrong and expecting to use apt-get & PPAs is not right?

  • You need to include a working systemd unit file in your package, and any config files needed by your program. I recommend looking for another daemon written in Go that has been packaged for Ubuntu and examining the source package (`containerd` is one that I know of, but it's probably worth searching for the simplest package you can find). The `debian/rules` file in it will be a good example of what you need to do. If you've never built a package before, start by reading the debian & ubuntu packaging docs/guidelines. – cas Sep 11 '22 at 00:53

0 Answers0