This week I noticed something strange about the disk IO of a server running Postfix. As soon as I logged in to the server I saw logrotate consuming 99% CPU and about 50% memory. Here’s how I diagnosed and fixed the problem.

First I looked at the contents of the logrotate status file:

tail /var/lib/logrotate/status
"/var/log/mail.log.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.gz.1.1.2.gz.1.1.1.1.1.1.1.1.2.gz.1.1.1.1"

That doesn’t look right. Some kind of loop has occured that caused every file in the directory to logrotate. Just to get an idea of the problem I looked at the size of the status file:

ls /var/lib/logrotate/status  -lh

In my case the file grew to a whopping 95MB.

First of all, kill whatever logrotate is doing:

sudo kill -9 PID

Now let’s have a look at the logrotate file for the mail log:

/var/log/mail.* {
        daily
        rotate 60
        copytruncate
        delaycompress
        compress
        notifyempty
        missingok
}

Looks like it matches all files called mail.* so mail.1.1.1.1.gz will also be matched and handled through logrotate again, and again, and again… The solution was obvious, after changing the first line to mail.log everything worked as intented.

Logrotate taking up a lot of resources is usually caused by a configuration error. The logrotate status file is your best friend in most cases.

A few months ago I waited in anticipation of my new phone getting introduced on stage by Apple. I frequently crawled the internet for new information on the iPhone 5C. Almost everything leaked and I had a pretty good idea of what my next phone would look like. I’ve been using my iPhone 4 for way too long up to that point and I wasn’t ready to just drop another $700 on a new iPhone. The 5C was supposed to be a cheaper phone but it wasn’t. It’s just last year’s hardware in a new case sold as brand new for $100 less than the 5S model. Revolutionary!

I should have seen this coming of course.

Anyway, right after the keynote in which Apple introduced last year’s hardware as brand new I started my search for the perfect Android phone. Something cheaper than an iPhone 5C but with a decent amount of power, preferably with stock Android. The HTC One, Samsung S4 and LG Nexus 4 looked most appealing to me. I finally settled for the LG Nexus 4 because of stock Android and the promise of rapid software updates.

You can sort of see this coming but after a while (2 weeks), using my iPad Mini started getting annoying. Using two mobile operating systems causes some UI confusion. The new Nexus 7 had just been introduced so I started watching some video reviews and bought one the same day. I gave my iPad Mini to my girlfriend who’s really happy with it.

The story continues because at the same time I was also looking for a new computer. My 2010 13” MacBook Pro started to slow down in photo editing software. The only Apple products powerful enough are the iMac and the Retina MacBook Pro. At the time, I didn’t want to settle for the Retina MBP because of the lacking graphics card. I tried one in-store and noticed some lag while pushing all of those pixels. And if I were to get a desktop computer like an iMac I wanted to be able to play games. Battlefield 4 was just around the corner after all.

I did some research, asked around, made a list of parts and clicked on the Place Order button. I was now the proud owner of a huge gaming rig for only half the cost of an iMac. My new Windows 8 powered, i5 bearing, AMD 7950 beast of machine runs Battlefield 4 on Ultra. I still can’t believe what this pc is capable of and it only set me back $1100.

Apple is really good at marketing something as revolutionary, brand new, something only they can invent, something you should really have. And then they charge a premium. It’s a business model I admire. They’re making a metric shitton of money but I’m not ready to give them an absurd amount of money again. Growing up I start to really think about what to spend my money on and gadgets come last on my list of priorities more often.

I can’t go back to using Apple products. I’m very pleased with my new Android and Windows powered devices. They do everything I require at half the cost while still offering similar or better performance as in any Apple device.

Flow for Reddit Still in beta but one of the best Reddit apps out there.

Facebook Messenger For keeping in contact with friends. The new Hangouts is also really good.

Google Now This makes my phone feel like something from the future.

Google Play Music Who doesn’t like free streaming music? I pay a subscription fee for even more streaming, it’s so good.

Real Racing 3 I have wasted hours on this game and I’m not even on 10% completion. There’s so much content.

Readmill A good looking app for reading books.

Wunderlist The best service if you want to have a list of todo’s and share lists with your girlfriend.

Zite Zite is for quickly catching up with the news. But the new Google News Stand app is catching up.