git @ openbsd with 'dubious ownership'

I’ve tried to make this post as a reminder to self for almost a year now. At some point my inner perfectionist tunes in and tells me it is not good enough to just write 1 line of the solution, there has to be some development and an interesting story to be told alongside the issue and the outcome; I finally give up and can only say there is none.

The Problem: Every time I update the hosting OS (OpenBSD) for this weblog the git-daemon stops serving my repos via git:// protocol. It is a permission thing, and since I often have a very short memory span I have to figure out the fix all over again on every new Puffy release.

The Cause: I have my git repos separate from ‘main’ user, as a dedicated ‘git’ user with a homedir /home/git that contains all my repositories. git-daemon by default (as all the other openbsd daemons) runs under its own user named after the daemon itself. After upgrade the rc config file gets overwritten by its ‘stock’ variant

The Solution: is probably not the ‘proper’ one since I never bothered to figure out a perfect way to organize my repositories (it is just a pile of shell scripts and couple of services like git-daemon and stagit). Anyhow: /etc/rc.d/gitdaemon has an option daemon_user that sets up the parental user for the process; instead of stock ‘gitdaemon’ I’m changing it to the ‘git’.

Fun fact: the draft of this post that I kept for a year looks like this:

describe how i change 'daemon_user' to 'git' in /etc/rc.d/gitdaemon every
time after openbsd upgrade.
without that option serving repositories with git:// using git-daemon
doesn't work.

Something tells me it is in itself a much better writeup than I did now :D