No, I'm not dead quite yet.
Due to a recent change of job, among other things, I've neglected my blog for almost four months now. But it's time to get back into the habit of writing interesting technical stuff, at least for a couple of months more, while I'm still able to write.
In these days I'm working on two personal projects:
I'm completing Crossbow, the minimalistic feed aggregator (a release will be ready soon!);
I'm resuming my experimentation with BSD.
This blog entry is about the second project.
I don't have a specific goal in my mind. I really just want to experiment a bit with *BSD, to gain knowledge on this family of classic UNIX systems. Possibly self-host some useful service.
As the title tells, these are random notes taken from a long time GNU/Linux user, not necessarily coherent, or even correct. Also they might span many blog entries.
A Raspberry in my home network. Later on I plan to attach it to the Open Internets, as soon as I've learned something about firewalls.
I installed FreeBSD since it is very convenient to do so. I can experiment on OpenBSD too, thanks to the friendly tilde.institute fellows.
How much RAM do I have?
# sysctl hw.physmem
Not wearing my drive off
As the raspberry platform uses a micro-SD memory, care should be taken to avoid wearing it off.
There's a nice article about this topic.
It turns out that FreeBSD 12 will automatically do the Right Thing™ if the root file-system is mounted as read-only in
Before finding this out, I've attempted to do this myself. I obviously don't need to, but in the progress I learned that:
mount(1)has special options for it:
mount -ur /for a read-only mount. It's not clear how this is different from
mount -o ro /. As it happens with Linux, it might be necessary to force the remount if some software is using the file-system (with
fstat(1)allows to check if some file is using the filesystem. This would be provided by
fuser(1)on GNU/Linux, or by
The FreeBSD syslog daemon does not create new files: it only writes on existing ones. If
/var/logis mounted in RAM (to avoid writing on the SD), it might be necessary to create these files by hand. It turns out that
newsyslog(1)is made for this.
In the default system configuration
newsyslog(1)is executed by
mount --rbind /etc/pkg /var/db/pkg
As mentioned in the strategies page of the afore
mentioned article, in order to use
pkg(1) to install
software, we need the database in
/var/db/pkg to be
accessible even when
/var/ is mounted in ram.
Installing ports would still need to mount
read-write mode, but the database would be consistent across
The article suggests to change the
and add a soft-link between
/var/db/pkg -> /etc/pkg, but I
thought that it would be more proper to solve this with a
The closest thing I can get is
mount_nullfs(8). In short,
let's add this line to
/etc/pkg /var/db/pkg nullfs rw,late 0 0