Whilst forking OpenRC from baselayout and tying it into a vanilla FreeBSD I found myself asking “Why the need to mount a memory disk?”

Well, we need an area to save service states, lock files, the dependency tree and a few other goodies even if no physical disks are mounted read-write. This is a little more challenging for BSD as we can only create disks of a fixed size, which is hardly at the cutting edge of efficiency. However, as baselayout used to be entirely shell script based this was the only option, but as we’re now backed by C for the most part I asked myself is there an alternative?

There answer is, of course, yes there is. We can use System V Message Queues. I’ll be looking into making an rc daemon which will handle service states, generate a dependency tree and use that to resolve the dependencies instead of each runscript instance trying to do this itself. This maybe a little complicated, and I have no experience of doing this so it make take a little while. Hopefully I can use semaphores to imitate the existing service exclusive file locks too.