SSS – automagic syncing

by hobbitalastair

I thought I’d finally post on my automated syncing system (from now on know as Snazzy Syncing System, or SSS).

The initial idea of the scheme came about when I was given my PC. Instead of managing both the PC and my Pi, manually updating the configuration on each one, and adding new packages if I decided to swap, say, from ‘aspell’ to ‘hunspell’, I decided that I’d create a system that would do that automatically!

Why not?

The initial scope for the project was quite extensive, because it needed to handle at least 2 computers with very different hardware and configuration. I looked at using solutions such as Puppet, Bcfg2, and Chef – however, they seemed overly complex for my limited needs, and more suited to larger groups of computers than I’m ever likely to have. I also needed a lightweight solution if I ever wanted to run it on my Pi – an interpreted solution wasn’t ever going to cut the mustard.

I eventually settled on a simple (ish) solution – using PKGBUILDs that depended on packages to ensure that they were pulled in as required, and a sub-system to manage my changes to configuration files.

Using this system, all I need to do to update is run

pacman -Syu

Provided my custom repo is up to date, any changes I have made will be pulled in. If I don’t want my Pi to have a desktop environment, I make a separate PKGBUILD, and only install it on the computers that need it. Combined with immix, which uses Unison to sync my files across all of my computers, I have a system which achieves the basic goals, fairly simply – right?

Well, not really. Pacman (rightly) refuses to overwrite configuration files, so I had to write patchman, and get each configuration file patched at install time. This added extra complexity to the install file, which also has to handle other, more complex tasks.

I am overusing pacman and PKGBUILDs.

For the moment, that is OK. I have a working system, that provides easy rollouts and reinstalls if required, and updates my systems to be consistent (most of the time).

However, it’s not perfect – so I will be writing a replacement at some point. I was thinking that it would be a good introductory project to learn Go with…