Sensible reboot monitoring

I have an embarrassing confession: we recently discovered that some ofour machines had been spontaneously rebooting every so often, and wehadn't noticed. This is not really a good thing; if your servers arespontaneously rebooting, you should know about it. We have a monitoringsystem, so of course the right answer is to have the monitoring systemalert us when a system reboots.

(Some of you are laughing sadly right now.)

The problem with alert-on-reboot is that you get alerted for


What determines how much work a ZFS resilver has to do

We lost another fileserver iSCSI backend the other day for the first time in along while, and this has gotten me thinking about how expensive a ZFSresilver is. What I really mean by that is some way to start guessing atthe amount of time that a resilver will take (or at least the relativeamount of time compared to another potential resilver).

In a simple world, the time to resilver would be proportional to theamount of data on the vdev being resilvered. ZFS doesn't work thisway


Why you need mass package rebuilds in some circumstances

In the previous entry , I mentioned thatsometimes you need to rebuild a package for reasons unrelated to anychanges to it; the example I gave was rebuilding packages due to fixinga code (mis)generation bug in your compiler. This may sound obscure, butin fact situations like this are more common than you might think. Youreally should be rebuilding packages after any significant change tothe basic toolchain and compilation environment, such as a significantnew version of GCC. It's also a good policy to build


The core problem with developers doing their own packaging

As I've discussed , Linux packagesystems generally have some degree of support for developersembedding all of the things you need for source packages directly in the master source anddistribution tarballs or the like. However, pretty much everyone nowdiscourages developers actually doing this; these days, distributionswould generally much rather have you let them do the packaging (and manyof them will ignore your work if you try to include it).

There are a number of pragmatic reasons for this; one of the largerones is that


A realization about ratelimit time horizons

Here's something that's smacked me in the nose recently as I startedworking with Exim's ratelimits .

When you have a ratelimit it's usually expressed in terms of 'X eventsin Y time' and you generally get to pick both X and Y. Mathematically,there is no difference in how many total events a ratelimit allows overa long time period if you scale both X and Y together; 20 events per10 minutes is the same as 120 events per hour.


The core difference between Debian source packages and RPMs

At least from my perspective, the two big source package formats inthe Linux world are Debian's and (source) RPMs. I've worked with both(although far more with RPMs than with debs) and recently I've formedan opinion on what the core difference between them is and what eachis better (or best) at.

The Debian source format is optimized for the case where the 'upstream'developer is also effectively the Debian packager (in what Debian callsa 'native' package


When I've interned Python strings

One day, I read the following on reddit's r/python :

Is manually interning a string every a good idea? I'm having troublethinking of a use case where the cost is justified outside thecompilation cycle.

and a reply:

I've yet to run into a situation where it was, but I guess it couldbe in a very restricted number of situations, such as a small set ofnon-literal strings generated over and over again (e.g. some sort ofparser


When you can log bad usernames for failed authentications

I've said before that when you log failedauthentications you should omit the login name if it's a nonexistentuser; otherwise, sooner or later you will log someone's password. Butsometimes this is inconvenient and you'd really like to log at leastsome nonexistent usernames; for example, you might want to find outwhich usernames attackers are probing.

The simple answer is that you can log nonexistent usernames whenyou know that they're not passwords . Of course, the devil is inthe


What the standard(s) say about the order of readdir()'s results

A while back I wrote about the pragmatic answer to what order readdir() returns results in . Inspired by ahigh-scoring Stackoverflow answer to a question about readdir() 's order ,today's topic is what the standards have to say about this. Or atleast the readily accessible Single Unix Standard , since you can find that online.

Reading Unix standards, like reading any standard, requires justas careful attention to what they don't say as to what they do say. The SuS page


A little trick and gotcha with Exim ratelimits

In light of recent events , I've beenexploring Exim's features for ratelimiting incoming email. In theprocess I have found something that I feel like documenting. Supposeyou're trying to establish what ratelimit settings you actually want(ones that won't cut off your users). The simple way to do this is tocreate a do-nothing ratelimit ACL stanza that exists just to log theactual rate volumes, something like:

warn  ratelimit = 10 / 10m / per_rcpt