Score:0

Best way to update a binary?

mp flag

So I'm making a load balancer that compiles to a binary. This will be scaled across multiple servers.

To update, the program itself will check a GitHub repo for a new release every 5 minutes, if there is a new release, it downloads it overwriting the old one, then would run the command systemctl restart lb.

Now my question is, is this a bad practice, are there any disadvantages to doing this, and is there a better practice for updating other than this?

--

Just a side note, running a cronjob is not ideal.

Score:0
cm flag

The recommended approach is to produce an OS package (.deb/.rpm/etc.) and offer it to the package manager.

You could utilize Github actions to generate the package, and upload it to a binary repository that creates the necessary meta files for a package repository.

The package should have the necessary commands to restart the service.

That makes replacing the service unit, the binary and supporting files trivial. Most package managers support some form of automatic updates. Even rolling back to an older release on a botched update is trivial.

You can set up your system to respond to an HTTP request that's called via Github actions (a webhook) after upload to the package repository, thus switching from a pull based polling approach to a push based approach that only triggers on an update of the git repository.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.