Update, 29th March 2016 The awesome Danny Tuppeny (@DanTup) has provided a much better solution to the problem. His question and answer are on the Unix Stack Exchange, and there's a discussion of the issue on Raspberry Pi's GitHub.

This is as much a reminder to me as it is a workaround for folks experiencing the same problem.

If you have postfix installed on a Raspberry Pi, you might experience the same problem as me - inability to send emails, with errors like this in your /var/log/mail.log file:

status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=opinionatedgeek.com type=MX: Host not found, try again)

Long story short - postfix uses its own resolv.conf file in /var/spool/postfix/etc/resolv.conf (because it chroots to /var/spool/postfix/). When postfix starts, it copies the existing /etc/resolv.conf (among other files) to the chroot location, and everything should just work.

On my Pi, it was copying over an empty resolv.conf file. My guess is that even though the dependency on the network was in the init script, some timing issue meant that postfix was copying the file before DHCP had set up the proper values in resolv.conf.

My nasty hack doesn’t solve the fundamental problem here (I’ll leave that to the experts), but just works around the problem by putting a ‘sleep’ in the postfix start command so it waits for a bit before doing the copying.

All I did was add the ‘sleep 5’ (and comment) to line 185 of /etc/init.d/postfix:

case "$1" in
    start)
        # Added by Geoff, 6th March 2016, to make postfix wait until
        # resolv.conf has been updated.
        sleep 5
        log_daemon_msg "Starting Postfix Mail Transport Agent" postfix

I then ran update-rc.d but I’m not sure that was necessary.

So future-Geoff, this is what you might need to do to get postfix working if something overwrites /etc/init.d/postfix. And for anyone else experiencing the problem, I hope you find this useful.

Tags: Weird Interweb Stuff
Created by on Logo15659OpinionatedGeek Ltd.Logo15659
Chuck Wendig
£10.32

‘Nice Current-Tech Hacker Thriller’
Score: 5/5

I thoroughly enjoyed this. It’s fun to read a hacking story that - for the most part - is set using current technology and techniques, and shows a bunch of different hacking styles (cracker, troll, social engineer and so on). I’m not at all sure how well this book will age, when we’re not in the current style of social-media world, but it was fun to read in the current times.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659
Bateman
£8.99

‘Local, But Harsher Tone’
Score: 3/5

The Man With No Name is back. I’m in two minds about this book. On the one hand, it’s still nice to read bits about Belfast in a real book, not just one from the ‘local’ section. On the other… Well, I’m not too sure about the unreliable narrator in this book - it seems a little different from previous ones.

The mother jokes are still there, but maybe a little harsher. The tone though feels different. Unsettlingly so. Maybe that’s intentional.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

‘Fun, Annoying, Mostly Legal’
Score: 4/5

Mark Thomas
£9.98

The book covers a lot of minor ways of demonstrating ‘I do not agree with this’, such as (this sticks in my mind…) doing a dance in front of a CCTV camera and then using a Subject Access Request (under the Data Protection Act) to request all footage of yourself. There are plenty of creative acts in this book and the author does go to pains to point out the legality of what he’s doing to those he’s dissenting against.

And on top of all that, it’s funny too.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

I’ve bought some Energenie bits and pieces to use with my Raspberry Pi. My plan was to play about with turning things on and off using cron jobs on the Pi, and maybe look at Node Red.

Here are a few things I wish I’d known before I bought some Energenie bits and pieces.

  1. Don’t bother with the ENER314 ‘pi-mote’ or the ‘starter kit’ I bought. The ENER314 has a very limited range (you can solder on an antenna if you’re brave enough), and it’s one way so it can’t control plugs like the MIHO005.
  2. If you want to control the MIHO005, you need the ENER314-RT.
  3. The software Energenie provide for the ENER314-RT doesn’t work with the Raspberry Pi 2. The Raspberry Pi 2 has been out for nearly a year now – it was released on 2nd February 2015 – so it’s worrying that the code to help you program the device hasn’t been updated yet.
  4. The example code from Raspberry Pi is a nice demo, but in its current form doesn’t work so well since it seems to forget pairings  when the Pi is rebooted. Or maybe that’s just my Pi. It’s hard to say, which makes this even more frustrating.
  5. The Rasperry Pi tutorial software doesn’t work with the ENER314-RT either (likely the same cause as 3).
  6. The Energenie documentation in general isn’t good – it’s missing important things (like what works with what), files referenced in the documentation aren’t where they’re said to be in the download package, and the download packaes seem to include the same library several times. Or maybe it’s a different version of the library with the same name, for different pieces of hardware?
  7. There’s some Python software on GitHub that should work with all Pis. I haven’t yet tried this, but I’m hopeful.

I do like the idea of the Energenie products but it feels like this is something done by an enthusiast in the company with little company support. That’s a shame.

Tags: Weird Interweb Stuff
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

I’m really getting tired of ‘origin story’ movies. They feel greedy.

Fun:

Superheroes superheroing

Not fun:

Superheroes not superheroing

Why make movies about superheroes not superheroing? I get that some feel it’s not a complete universe if it’s not explained where a character came from, but it doesn’t look like that’s why they’re being made now.

It looks to me like companies are intent on ‘launching a franchise’. (Ergh, I hate two of the three words in that phrase). They’re so intent on the money-grabbing franchise that they can end up making an awful movie. And then the franchise fails to take off because of the bad movie that was only made because they wanted to launch a franchise. And then all the good stories go unmade.

Please stop.

Tags: Clueless Idiocy
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

‘The Expanse Saga Continues’
Score; 4/5

James S. A. Corey
£9.98

More hijinks with the usual folks, and the introduction of more folks. Anything else I say would give away some things about the book and I don’t want to do that so I’ll just say that if you read the previous books in the series you know what you’ll be getting with this one.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

‘Good, Bad And Meh’
Score: 3/5

I’d read some of the Hyperbole and a Half blog posts (I particularly remember the ones on depression) so I wasn’t completely new to the style of writing or the drawings when I picked up SWMBO’s copy of this book.

This book is a collection of stories. I get the feeling they’re mostly taken from blog posts but I don’t know if that’s true or if they all are – certainly some of them felt familiar. They didn’t all though, but then again I haven’t read all the blog entries.

Some of the stories are funny, some of them are sad and poignant, and some of them are just, well, ‘Meh’ is the best way I have to describe it.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

‘More Pew-Pew Space Battles’
Score: 4/5

James S. A. Corey
£8.99

If you liked the first book of The Expanse, Leviathan Wakes, then you’ll like this too. There are even more Game of Thrones overtones with this book too.

Also, it’s a testament to my ignorance of Shakespeare that I didn’t know who Caliban was. Oops.

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659

‘What Was The Point?’
Score: 2/5

Kim Stanley Robinson
£3.99

I started this and I wasn’t really sure where the author was going with it. I stuck with it out of curiousity. And then I finished it, none the wiser.

There’s a bit of a story there, but I think whatever the author was aiming for was just too subtle for my tiny mind.

(Now that I’ve come to write about it, I’ve found out it’s number three in a series of three. Guess that explains it a bit. Still, I’ve no urge to go and read the other two now.)

Tags: 4 Word Book Reviews
Created by on Logo15659OpinionatedGeek Ltd.Logo15659