/etc under revision control reddit / BSD ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-16 17:17 Hello Who put their /etc under revision control ? Why ? Which one ? Be it rcs (which is in base at least in the BSD I use - OpenBSD), git (which I use already a bit) or anyother one ... ---------------------------------------------------------------------- gumnos · 2020-07-16 18:23 I use `rcs` for precisely that reason—it used to be in the base install of FreeBSD and OpenBSD (and possibly NetBSD). However FreeBSD has since dropped it from base, so I'm now a little more open to alternatives. Because there's rarely a cross-file correlation, the individual-file- tracking nature of `rcs` still works well for me, so I have installed it on my FreeBSD machines largely for just this purpose. That said, I prefer `git` or `mercurial` or `subversion` but they require more overhead than a single repository file. So if I were to leave `rcs`, I'd probably turn to [`fossil`](https://fossil-scm.org/) which sticks with the "everything is in a single repository file" format. ---------------------------------------------------------------------- [deleted] · 2020-07-16 19:10 [deleted] ---------------------------------------------------------------------- gumnos · 2020-07-16 19:30 If you have ZFS and can roll-back to a previous snapshot before you screwed things up, it often serves the same purpose. But sometimes things change and it's handy to know what, and have a means by which to roll-back to previous versions of a config file. I've hosed systems more than once and have been thankful for the ability to resurrect a prior version. ---------------------------------------------------------------------- kageurufu · 2020-07-16 20:09 Its nice being able to make a bunch of changes, and knowing everything you changed. or "Samba worked last month, whats different now?" and snapshots aren't as useful as actual version control, since you can't get a series of diffs as easily ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-16 21:24 I am thinking of using git (or got ?) between the three OpenBSD systems I manage. Advices ? ---------------------------------------------------------------------- quietriotgear · 2020-07-17 00:17 search "etckeeper" ---------------------------------------------------------------------- sherlockmao · 2020-07-17 02:45 etckeep has a search order for bzr, git, hg, etc. Right now, I prefer zfs snapshot. ---------------------------------------------------------------------- fwaggle · 2020-07-17 08:11 > If you have ZFS If you have zfs there's `zfs diff`, and then you can mount the snapshot somewhere and diff the files that changed to see the actual changes. ---------------------------------------------------------------------- witheld · 2020-07-17 09:56 No need to mount anything when there's an invisible .zfs folder ready for action ---------------------------------------------------------------------- fwaggle · 2020-07-17 10:35 I've been on Ubuntu too long and forgotten about that. :( ---------------------------------------------------------------------- gumnos · 2020-07-17 11:48 Huh, handy to know. Sounds easier than my manual method of `diff -u /.zfs/snapshot/${snapname}/${path} /${path}` ---------------------------------------------------------------------- gumnos · 2020-07-17 11:53 My biggest concern with `git` (and really with any version control, so it's more a matter of testing it) is with ownership/permissions. If I check in some private information that is owned by `root` or some dæmon account and it has restrictive permissions, but then I check it back out and it's owned by whoever checked it out instead of the original owner, or the permissions have changed, it's a security issue. So before signing on for any such version-control, test it to verify ownership/permissions before & after doing a checkout. ---------------------------------------------------------------------- reinoudz · 2020-07-17 12:18 I've never really needed it. If I'd need, I'd probably just copy the old file /etc/hosts to /etc/hosts-$date or the like ---------------------------------------------------------------------- dim13 · 2020-07-17 13:07 Totally agree, just wanted to add, that [got](http://gameoftrees.org/) will be hopefully soon in tree (it is in ports now). ---------------------------------------------------------------------- tar-xz · 2020-07-17 13:37 I'm using etckeeper on a couple of systems. It is available on both most BSDs and Linux distributions. - Why you ask? Although we don't do much changes in /etc, unfortunately at my current place we still have to many Unix-like OS in production so automation is not really possible there (I'm trying to get out the old versions but still much to do) Etckeeper's daily commit helps me in tracking changes and random changes either updates or (more often) collegues (or even myself..) inflict on our systems. We have a couple of systems (Debian-based appliance OS) where the vendor has the habit of changing defaults and shipping new configs in what they declare bugfix-only updates. (But I need to install since they also include security fixes) Having /etc versioned has helped me a couple of times to detect modifications and to pin them down to a day and event - in those previous cases, specific updates that should have been bugfixes only as per their release notes. ---------------------------------------------------------------------- gumnos · 2020-07-17 14:16 is that only planned for OpenBSD or is there a chance it would land in FreeBSD's base too? ---------------------------------------------------------------------- CSI_Tech_Dept · 2020-07-17 14:34 You can, it's just a bit more involving: https://www.reddit.com/r/BSD/ comments/hsdsd5/etc_under_revision_control/fycmr9v ---------------------------------------------------------------------- trevman · 2020-07-17 14:37 This is how I was taught back in the day. Will check out fossil ---------------------------------------------------------------------- theSarif · 2020-07-17 15:22 I never really thought to do this, but I might try doing this with Darcs or Pijul, just for fun. ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-17 21:32 It's not in OpenBSD ports. Sadly. ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-17 21:34 Good remarks. Thanks. ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-18 19:55 So I checked and like you said it's a concern. What VCS software do you know keeps track of ownership and permissions ? ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-18 19:56 I actually tried to use got, and it does not like non-empty directories, so far I see... ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-18 19:57 Got uses stuff specific to OpenBSD, like pledge. Does FreeBSD know of pledge ? ---------------------------------------------------------------------- gumnos · 2020-07-18 21:14 I had understood that a spin was built without OpenBSD-specifics, so if ported to other BSDs or Linuxen that don't have `pledge`, it just wouldn't provide that extra safety. ---------------------------------------------------------------------- jmcunx · 2020-07-19 22:30 I see no reason to stop using rcs under OpenBSD, unless you want to use something different. OpenBSD uses OpenRCS instead of GNU rcs, so I doubt it will be removed from base. ---------------------------------------------------------------------- StephaneiAarhus · 2020-07-20 18:12 But cannot send it on a remote server I think. Which would have been cool. Git is super for it has everything I would like, but doesn't respect ownership. ---------------------------------------------------------------------- jmcunx · 2020-07-21 18:56 For /etc, I usually tar and encrypt /etc and send it to a remote system. You probably do not want files from /etc/ sitting in git unencrypted :) ---------------------------------------------------------------------- rob2g2 · 2020-07-22 22:19 we have got capsicum in FreeBSD ---------------------------------------------------------------------- edthesmokebeard · 2020-08-03 23:02 The Ubuntu Curse.