freebsd-update: “/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory”

This morning, I finally updated my web server to FreeBSD 10.2-p6 using freebsd-update. Normally I like freebsd-update, but this morning it decided to be cranky.

As usual, it was cranky because I didn’t know what I was doing.

First, I should say that I don’t need to update my hosts that often. If there’s, say, a mountd(8) security advisory, I don’t bother. And when I ran bunches of FreeBSD boxes, I ran freebsd-update through ansible.

This means I’m not terribly familiar with the output.

So, I run:

# freebsd-update -F -r 10.2-RELEASE upgrade

There’s the usual “downloading metadata” messages, then a bunch of stuff on updating patches.

I then get presented with an /etc/mail/sendmail.cf diff, saying some of the innards of that file has changed. Fine.

Then I get:

The following file will be removed, as it no longer exists in
FreeBSD 10.2-RELEASE: /etc/ntp.conf
Does this look reasonable (y/n)?

Wait… FreeBSD dropped /etc/ntp.conf? What, did they drop ntpd? Who do they think they are, OpenBSD? I’m sure that’s in the release notes, had I bothered to read the release notes. Fine, I’ll install openntpd from packages after the upgrade. No biggie. But I want /etc/ntp.conf to stick around, as I have custom twiddles in there. I think. It’s been a while.

So I answer n. Just like I would with mergemaster.

And freebsd-update ends.

Fine. That’s all the updates, right? I saw stuff download. I then do:

# freebsd-update install
No updates are available to install.
Run '/usr/sbin/freebsd-update fetch' first.

What fresh hell is this? I saw all sorts of stuff download!

I rerun the freebsd-update command, and this time I notice in the output:

/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory

Something’s missing.

I add -F, to say “hey, re-download everything.”

Same result.

Eventually, I let freebsd-update take /etc/ntp.conf. The upgrade kept running after that, downloading a bunch more stuff and finally telling me to reboot and run freebsd-update install.

The takeaways here are:

1) freebsd-update is not mergemaster. Answering n anywhere makes the update stop before it’s finished.
2) Read the release notes.

BTW, ntpd is still part of FreeBSD 10.2. I don’t know why the update wanted to blow away my ntp.conf rather than point out any diffs.

September 2015 updates

I haven’t done a general update since June? Well, let’s give where things are at the end of September. Because it’s October, and for my whole career my status reports have always been behind, and I see no reason to change now.

FreeBSD Mastery: Advanced ZFS is underway. Right now it’s in Allan Jude’s capable hands, but Allan has this thing called a “day job.” Apparently when you’re the It should be out before the end of the year.

In the meantime I’m mining words for FreeBSD Mastery: Specialty Filesystems. It covers NFS, nullfs, NTFS, and even filesystems not beginning with N. (Can’t think of what those are offhand, but I’m sure there are some.)

Immortal Clay 2, or Kipuka Blues, is at the line editor. So I’m waiting on that.

I’m spending 60-90 minutes a day on a new project called “Butterfly Stomp Waltz.” This started as a short story but, well, things happened–mainly that the folks who read it demanded the rest of the story. (Those of you eager for the new nonfiction books: if I stop writing fiction, my tech writing speed plunges. So this is to your benefit too.)

I suspect the next tech books will be on PAM, then something on OpenBSD httpd/relayd. (I’d really like to see httpd ported to more operating systems before I do that book, though.) I do intend to head towards the FreeBSD jails book, but after spending a year on FreeBSD filesystems I feel a definite need to poke elsewhere for a while.

Reviews and Interviews

Two chunks of news on my tech books yesterday:

1) nixCraft’s Wendy Michele wrote a very nice review of FreeBSD Mastery: Storage Essentials. Apparently I need to send her a copy of the ZFS book (which I’m perfectly okay with doing).

2) BSDTalk 2^8 discusses FreeBSD Mastery: ZFS. Recorded at vBSDCon, my coauthor Allan Jude does a good job talking about the book. Fortunately, someone came into the room before they were quite finished, cutting the interview short before Will could ask “What was it like working with Lucas?”

On “unpleasant truths” in tech books

(Part of an intermittent continuing series on tech writing. People have urged me to write a book on how to write tech books for years. If I collect enough of these, I just might.)

I’m working on FreeBSD Mastery: Advanced ZFS, and am desperately hoping to have a first draft finished and out for tech review before my September writing workshop. And I’ve hit a situation I’ve hit many times before, but not in a way that will be so obvious to so many readers.

OpenZFS runs on many operating systems. FreeBSD is considered a Tier 1 OpenZFS platform, which is cool. But even so, not everything works quite the way you’d expect.

The current master document on tuning OpenZFS for better performance is Adam Leventhal’s article on the Delphix blog. The performance chapter needs to cover everything in that article and more, in a slower and more easily accessible manner.

But not everything on that blog post works on FreeBSD.

Some problems are straightforward to fix. The DTrace scripts are written for illumos, so some of them need minor tweaks to work on FreeBSD. I can ask around and get a knowledgeable kernel person to fix them (thank you, Ryan Stone!). Many parts need more explanation and context than Leventhal provides–which is great, because otherwise I’m out of a job.

But there’s the hard category: things that just don’t work on FreeBSD.

You can tune almost everything in ZFS, including how async writes perform. But the async tuning knobs are not useful without the speedometer that measures the impact of those changes on your hardware.

Performance tuning without measuring is not tuning: it’s voodoo. And not the voodoo religion that people sincerely practice, but the cheesy comic book thing that appears in any number of B movies when the filmmaker couldn’t be bothered to do any actual research.

The DTrace script that measures the effects of tuning async writes won’t work on FreeBSD. There’s a PR on this issue, but it’s sat there for three months now without anyone claiming it.

The Advanced ZFS book must address this. The issue for me isn’t so much the actual FreeBSD issue, but “how should the book address this?”

I could say any of the following.

  1. “FreeBSD is not as tunable as illumos.”
  2. “If you want to tune async performance, you’ll need to apply the patch in bug 200316 and rebuild your kernel. Unless someone happens to merge this patch into the kernel after this book comes out.”
  3. “Async performance? Who says you can tune async performance? I know nothing of this.”

Which is the correct path?

The first rule of writing a tech book is: serve your reader.

Or, as Mickey Spillane famously said, “I have no fans. You know what I got? Customers. And customers are your friends.” I must tell them the truth.

Number 3 is the easiest to write–just pretend it doesn’t exist. How many people actually need to tune async performance anyway? But the feature is in OpenZFS, and it’s fair for my readers to ask about it. Many readers will read my warnings about the feature, dismiss said warnings, play with async write tuning, and reluctantly concede that the warnings were correct.

Ignoring the matter is a disservice to my customers, so it’s out. As in so many things, the easiest thing to do is the wrong thing to do.

For most writers, in most situations, the correct answer is both #1 and #2. Admit the weakness up front. Don’t try to cover it up. State it flat-out for your readers:

“FreeBSD’s ZFS async writes are not as tunable as illumos’.”

Or, more accurately:

“Yes, you can tune FreeBSD’s ZFS async writes, but at the time I write this you cannot measure the effect of that tuning. So don’t do it. It won’t help most of you anyway. If you really must, look at this bug and study this blog post, if it’s still there.”

Yes, I’m a BSD guy. I’ve been a FreeBSD committer. I’m friends with a bunch of OpenBSD committers. I believe in the BSD philosophy–it comes straight out of my Boy Scout days. (Yes, I’m an Eagle Scout with the first palm, believe it or not!) I don’t want to diss any BSD, even in such a tiny matter.

But as a writer, it’s my job to speak the truth. (I’d argue this applies for all kinds of writing, not just tech writing, but it’s unquestionably 100% true for tech books.)

I could also take action before the book comes out, by using my influence as “the biggest BSD author” to whine at people until someone fixed it. Most authors don’t have that option, but I know these folks, and I could tag them all on Facebook until someone changed it. I could go to my fans and say “Fly, my flock! Fly to every FreeBSD developer you know, and throw this bug in their faces until they pay attention!”

But this method breaks my “don’t be a jerk” rule. (Yes, I have that rule. Shut up, Bob. And Warner! And–oh, fine, never mind.)

Another problem with this approach is, there might well be a very good reason why this patch isn’t merged. FreeBSD is not illumos. This apparently simple patch might to strange and terrible things to hosts in certain circumstances. Maybe it boosts latency or launches ICBMs at the nearest penguin sanctuary. I’m a writer, and totally unqualified to make this judgment.

Nevertheless, I’m going to try a little bit of the influence approach. Maybe I’ll write a blog post about the issue, hoping that someone of influence will see it. A few influential FreeBSD folks follow my blog. Perhaps someone with the necessary skills will take interest and either close the bug with an explanation or commit it.

(Me, passive-agressive? Moi? Never!)

I will have books at BSDCan

The printer says that they’ll have FreeBSD Mastery: ZFS to me before I leave for BSDCan.

And they’ve sent UPS tracking numbers. Numbers that UPS acknowledges. While they don’t show a delivery date yet, UPS says that the boxes exist.

So I’m pretty confident in saying that I’ll have books there. And I take Square.

The list price is $24.99 US. Given the exchange rate, they’ll be $25 USD/$30 CAD for a “FreeBSD Mastery: ZFS” print/ebook bundle.

WordPress versus FreeBSD

I recently migrated my web site to a new FreeBSD install, configured so I could use ZFS boot environments. This upgrade crossed FreeBSD versions (10.0->10.1), filesystems (UFS -> ZFS), and PHP versions (5.5 -> 5.6).

And my WordPress pointy-clicky upgrades stopped working. Every time I ran an upgrade, the web gui hung with:

Updating Plugin Honketyblatt (1/1)

The web site would site there, forever. Enabling WP debugging gave me no error messages.

If I had the job of running WordPress sites, I would have an automatic tool that processed the upgrades for me. It’s not, so I don’t.

I use the FreeBSD WordPress package to get all of the dependencies, but manage my actual WordPress sites in a separate directory. It turns out that the FreeBSD WordPress package doesn’t list all of the modules that you need for a self-maintaining WordPress install. My old server had a few packages that the new one didn’t.

If you want to use WordPress’ self-updating features, be sure to install the following packages in addition to the FreeBSD-recommended defaults.

php56-tokenizer
php56-zlib
php56-zip

I installed these packages, and everything started working.