Monday, July 13, 2015

Upstart Configuration Generator for Go

In the past I have talked about how great it is to use technologies that simplify everyone's lives.

One of my favorite productivity boosts was moving to Go because I was able to eliminate Chef. With Go, there are no dependencies to install, and almost nothing to configure on the target server.

One thing you will want is a program to supervise your Go program. If it crashes or the computer reboots, the supervisor will start it up again.

One really great program for this is Upstart. It is lightweight, easy to interact with, and is installed on most Linux distributions by default.

While you could use Chef, I feel it is overboard for this purpose. You could easily write a quick shell scrip to create it, or put it in your userdata. All of these approaches are not very optimal or DRY when you are shipping many services.

So I created a new package called upstartConfig. It will generate an Upstart configuration file for the executing program. Just import the package, add a command-line flag to run the code within, and you'll have a nice new Upstart configuration file.

Take it for a spin and let me know how it works!