Archive | 2013

Error Reading PID From File (0 Byte) With Monit After Service Crash

Sometimes services crash badly, in this case I was trying to stabilize an old server running nginx and PHP via Fast-cgi. It crashes quite often, so I set up monit on it – but I noticed monit has stopped doing it’s job due to the following batch of errors:

[06:02:24] error : monit: Error reading pid from file '/var/run/'
[06:02:25] error : monit: Error reading pid from file '/var/run/'
[06:02:26] error : monit: Error reading pid from file '/var/run/'
[06:02:27] error : monit: Error reading pid from file '/var/run/'
[06:02:28] error : monit: Error reading pid from file '/var/run/'
[06:02:29] error : monit: Error reading pid from file '/var/run/'

Now the problem was, the PID file was there, but it was 0 bytes for some reason – so monit couldn’t read from it. I have a fairly regular monit setup for the normal PHP monitoring, something like:

check process php-cgi with pidfile /var/run/
start program = "/etc/init.d/php5-fcgi start"
stop program = "/etc/init.d/php5-fcgi stop"
if totalcpu > 60% for 2 cycles then alert
if totalcpu > 80% for 5 cycles then restart
if totalmem > 1200.0 MB for 5 cycles then alert
if failed unixsocket /var/run/fcgi.sock then restart
if 3 restarts within 5 cycles then timeout
if failed host localhost port 80 protocol http
and request "/healtcheckfile.php"
then restart

And this worked fine in most cases, but when something happened that caused a 0 byte PID file, monit would totally ignore the process with the following error:

[06:02:50] error : 'php-cgi' failed to start
[06:04:50] error : 'php-cgi' service timed out and will not be checked anymore

The solution to this problem, is to delete the PID file if it’s 0 bytes and restart the service so it creates a new, valid PID file. I achieved this with the following:

check file with path /var/run/
if size = 0 then
exec "/bin/rm /var/run/"
start program = "/etc/init.d/php5-fcgi start"
stop program = "/etc/init.d/php5-fcgi stop"

If you encounter the 0 byte PID after a crash and this works, you should see the following:

[11:21:39] error : '' size test failed for /var/run/ -- current size is 0 B
[11:21:39] info : '' exec: /bin/rm
[11:23:39] error : '' file doesn't exist
[11:23:39] info : '' trying to restart
[11:23:39] info : '' stop: /etc/init.d/php5-fcgi
[11:23:39] info : '' start: /etc/init.d/php5-fcgi
[11:25:39] info : '' file exist
[11:25:39] info : '' size succeeded

Good luck!

Tags: , , , , , , , ,

Continue Reading No CommentsInternet & Tech, Sys Admin & DevOps

Happy 1st Wedding Anniversary To Us!

It’s been quite a year, post wedding, we’ve had some time to ourselves, and some money to do some things we wanted to do – like our epic Eurotrip 馃檪

And some diving too at Pom Pom, and various other trips here and there.

People always ask me what being married is like, how it’s different – honestly on the surface it’s not that much difference. Especially when you’ve been together for a long time like we had before getting married (8 years).

It does put some sort of more serious undercurrent on the relationship, as now it’s really permanent – but we always treated it that way anyway. It’s funny how priorities change as you get older, and it’s true when you look for someone to spend your life with – don’t look for the ‘best’ person you can find – look for the person who makes you the best version of yourself possible.

Thanks for being that person to me Kim 馃檪


May we have many more incredible years together.

Tags: , , , ,

Continue Reading 2 CommentsSerious Issues

Epic Eurotrip Time!

Just spent a few days in London seeing the sights and eating some awesome food.

Now am at Dover ferry port in the middle of the night to catch a ferry to Calais, in France. My first ever time taking this trip.

After that we have an epic drive around Europe something like the map below. Can’t wait to get on the San Bernadino Pass in Switzerland.

So if you try and contact me in the next 10 days or so, you’ll probably be out of luck.

View Larger Map

Tags: , , , , , , ,

Continue Reading 2 CommentsTrips & Travel

Bosch Clean Diesel – Diesel Vehicles Are Not Dirty, Smelly Or Sluggish

I’m a big fan of diesel cars, because well I’m a big fan of torque – hence my driving a Mitsubish Airtrek Turbo. My car is getting old though and I’m seriously considering changing it – some of the new cars are really efficient in terms of fuel consumption, but they just don’t have enough oomph for me, where as a turbo diesel does.

I wrote about Diesel cars a while back when I tried out the new BMW 320d and 520d at The BMW Eco Drive Experience 鈥 Diesel Rocks!.

My wife also changed to a Diesel car earlier this year, a Ford Focus TDCi she calls Henry, and well I’m really considering getting a diesel car too.

I recently found out about Bosch Clean Diesel, at Bosch Diesel Systems, they are continuously improving diesels, making them more economical, more powerful and more environmentally friendly. A diesel hybrid, for example, combines the benefits of the diesel’s reduced fuel consumption and CO2 emissions with the advantages of electric drive. Modern exhaust-gas treatment reduces emissions to a minimum and makes diesels “clean”.

Bosch Clean Diesel

People in Malaysia particularly, tend to have a lot of misconceptions about diesel cars, mostly linked to old technology – and sadly linked to the quality of the diesel available for us here (which is only Euro2 standard).

We were originally supposed to get Euro 4 grade diesel in 2012, and then it was pushed to 2014, and the last I heard it was sometime in 2015.

The current fuel quality leads to a distinct lack of vehicle options for people wanting to purchase a diesel powered car, right now as far as I know, there are only the BMW variants (320d/520d), the Mercedes equivalents (CGI models) the Ford Focus TDCi and the Peugeot 508 HDi. Other than pick-up trucks and commercial vehicles of course.

Every major manufacturer has a diesel variant and in Western Europe over 50% of vehicles sold are diesel (most of the people I know in the UK drive diesel cars).

Some of the things people think about diesel cars are:

  • Diesel cars damage the environment
  • Diesel cars are loud and noisy
  • Diesel cars are sluggish
  • Diesel cars are slow
  • Diesel cars are expensive

Now let’s have a look at these:

  • Diesel cars damage the environment – clean diesel engines emit about 25% less carbon dioxide than petrol equivalents
  • Diesel cars are loud and noisy – not any more they aren’t go test drive a 520d and tell me if you can hear anything
  • Diesel cars are sluggish – this is the worst one for me, diesel engines generate a LOT more torque than a petrol engine (around 50% more) so they are far from sluggish, the BMW 320d puts out 380Nm of torque – go check your cars torque figure
  • Diesel cars are slow – many race cars are now powered by diesel (a diesel car has won Le Mans for many years in a row)
  • Diesel cars are expensive – Nope, they save you time and money using around 30% less fuel and requiring you to refill less frequently

Are diesel cars ugly? Er no, this is the 2013 BMW 320d M-sport – which is for sale now:

BMW 320d M-Sport

There are other concerns too of course, like the fact the government is pushing for higher percentage of Biodiesel to help the Palm Oil industry, right now we are using B5 diesel (5% bio-fuel) – but they want to implement B10 (10% bio-diesel) which most modern, clean diesel engines can’t use.

Especially when the fuel is Euro 2, if it’s Euro 4 most cars are fine up to B7 – but B5 is still the best compromise.

Either way I hope more people get educated about diesel in Malaysia, there is more support from car manufactures and the government helps the industry too by sticking to B5 and enforcing Euro 4 production sooner rather than later.

Bosch will be helping all parties along the way, if you want to learn more you can check it out here –

Tags: , , , , , , , , ,

Continue Reading 7 CommentsAdvertorial, Cars/Motorsport

Visiting Celebes Beach Resort at Pom Pom Island, Sabah – Malaysia

So we found out about this place called Pom Pom Island last year at MIDE (Malaysian International Dive Expo), I’d honestly never heard of it before and couldn’t even point to a region on the map where I thought it might be.

It turns out, it’s in Sabah, about 30 mins boat road from Semporna, which is about 2 hours drive from Tawau airport. It’s not surprising though, with there only being 2 resorts on the entire island. One is a proper high end resort with cabins on stilts called Pom Pom Island Resort, rooms go from RM600-800 a night and it’s not a particularly dive oriented place.

The resort we found out about was Celebes Beach Resort (CBR) who were offering a 3d2n dive package for RM999 (regular price RM1280). It’s a pretty good deal as it includes return transfer from Tawau including the boat and unlimited shore dives (and yes it has a really nice house reef).

We decided that was too short, so we ended up going for 5d4n back in May, we booked the trip last December and have been excited about it ever since! I haven’t been diving since my birthday last year at Pulau Weh.

It was quite a trek to get there, including getting up at 4.30am to catch a 7.30am flight (flight is around 2hrs+), then a 2 hour van drive, then the boat across – I think it’s about 7 hours in total door to door. But the view from the boat across from Semporna set us in the right mood straight away.

From Semporna to Pom Pom

There was 13 of us in total, 11 divers and 2 non-divers – quite a gang 馃檪 This was what greeted us when we stepped off the boat onto the island, blue skies and clear emerald waters – really a paradise.

Pom Pom Island

Another awesome thing about CBR is it directly faces the sunset, so after a hard day diving you can just chill and take in the sunset with the gentle sea breeze and the sound of lapping waves.

Pom Pom Sunset

Well that was the case unless you had a bunch of Chinese tourists in front of you shouting at each other and doing cheesy poses for the entire sunset…yes that happened.


Other than that is was spectacularly peaceful and beautiful.

Pom Pom Sunset

This is the beach directly in front of Celebes Beach Resort, and yes it’s rather nice 馃檪 You can just walk straight in from there to dive the house reef.

Celebes Beach Resort

It’s a cute resort, it has air-con and hot water (although if it’s doesn’t rain much the water gets salty as the water table depletes).

Celebes Beach Resort

All meals are included (breakfast, lunch, tea time and dinner) and there’s a free flow of tea/coffee/milo and water. You can also buy beer & soft drinks at fairly reasonable prices.

This is the whole gang including the 2 dive masters (Matt & Graham) and the Instructor/Resort Manager Nurul.

Pom Pom Island

I think it’s pretty safe to say we’d head back there again, beautiful place, chilled vibe and REALLY good diving. I’ll write about the diving aspect in the next post. It’s not the cheapest place to go, and it is a trek to get there but IMHO it’s totally worth it.

Both Air Asia and MAS fly there, you can get the tickets pretty cheap during promos, so check it out. You can find Celebes Beach Resort on Facebook too here.

Goodbye for now Pom Pom.

Goodbye Pom Pom

We shall meet again!

Tags: , , , , , , , , , , , ,

Continue Reading 6 CommentsMalaysia, SCUBA Diving, Trips & Travel

Couch-to-5k – Week 1 Workout 1 Conquered!

So I didn’t count my first try, because I only got half way through (I did about 1.04 miles in about 16 minutes and then collapsed).

I had my rest day, as I should, then today I retried the first workout with new, more reasonable speeds. After some reading, a jog should be quite slow, you should be able to hold a reasonable conversation and drink water when you are jogging.

If not, you are probably going too fast, or actually running. That’s what happened to me on the first day, I had my brisk walk at 3.5mph and my jog at 7mph – which is actually pretty fast (almost an 8 minute mile, way too fast for a beginner).

So I went down to 3.5mph for my 5 minute brisk walk warm-up, 3mph for my walking intervals and 5mph for my jogging intervals. It was still a good workout, but I didn’t collapse and I made it all the way through.

I even used the first minute of my cooldown to do a quick 1 minute 7mph run 馃檪

Couch-to-5k Week 1 Workout 1

Not too bad, ended up at 1.84 miles in 30 minutes 馃檪 That’s approximately a 16 minute mile overall, and a 12 minute mile for the running sections (far more reasonable) and would have me doing a 5km run in about 50 minutes (that’s more walking than running though). Onwards and upwards!

Tags: , , , , , , , , ,

Continue Reading No CommentsCouch-to-5K, Fitness

The Pa-aling Divers Of the Phillipines – Compressor Diving

Every time I watch this video I’m like…WHAT. The technical term for this is Surface-supplied diving, and this type is known as compressor diving.

Seriously 40 metres, no safety stop, not even a slow ascent. Their DCS (Decompression Sickness AKA “The Bends”) symptoms are so bad some of them go back down just to relieve them.

No BCD, and some of their fins look like ping pong bats..

Apparently one of the cameramen went for a drive dive using their gear..pretty scary stuff.

Tags: , , , , , , , , ,

Continue Reading 1 CommentSCUBA Diving

Couch-to-5k & A Treadmill & Me

So we’ve had a plan to get a treadmill since we bought this house, we even allocated a space for it on the upstairs landing and had a plug point put in the floor – especially for the treadmill. But due to the house, the renovation, then the wedding – we had no budget to actually buy the treadmill..

So the poor lonely power socket has been gathering dust for the past 2 years, and has only been used for steaming clothes, ironing and vacuuming. But a week or so ago, we were at 1-Utama to watch a movie and we happened to see the treadmill we’ve been looking at (actually a newer model) on sale at a pretty good price.

There’s not a whole lot of treadmills available for sale in Malaysia (fitness, what?) so we have limited choices, we ended up getting a NordicTrack T8.0, which honestly doesn’t have great reviews. But it feels comfortable and has decent features (28 workouts, mp3 line in, fan, incline etc).

Last week we had it delivered and set up 馃檪

NordicTrack T8.0

And honestly I had no idea where to get started, so I did some googling (as per usual). After some reading I came across this program called Couch-to-5k, which seems ideal for me.

I’m not terribly unfit, as I walk my dog about 1.6km twice a day – but I’m not terribly active either and I certainly can’t sustain a decent running past a few minutes without collapsing. I do spend far too much time sitting in front of the computer.

Too many people have been turned off of running simply by trying to start off too fast. Their bodies rebel, and they wind up miserable, wondering why anyone would possibly want to do this to themselves.

You should ease into your running program gradually. In fact, the beginners’ program we outline here is less of a running regimen than a walking and jogging program. The idea is to transform you from couch potato to runner, getting you running three miles (or 5K) on a regular basis in just two months.

Sounds reasonable to me. So I grabbed the Android app here for US$2.99 and today I took it for a spin.

I collapsed after about a mile (15 minutes) of alternate jogging/walking. After some post work-out research, it seems my jogging speed is too fast for a beginner and I won’t be able to sustain the workout. I was walking at 3-3.5mph and jogging at 7mph, it seems like I need to slow it down a bit to maybe 2.5mph for walking and 4.5-5mph for jogging.

Perhaps I’ll be able to complete the entire 20 minutes then. But one thing is for sure, after spending the damn money on the Treadmill I am going to be able to run 5k continuously – and hopefully lose some weight in the process 馃檪

I plan to do a real 5k race when I’m ready, the program should take around 8 weeks but I might take a little longer, there’s no shame in repeating days/weeks.

Here’s to fitness!

Tags: , , , , , , , ,

Continue Reading 9 CommentsCouch-to-5K, Fitness

Petronas Motorsports – The Ride

AMG makes some great cars with Mercedes, a favourite of mine being the amazing gull-wing, 6.2L V8, 563HP Mercedes-Benz SLS AMG. What a beautiful car!

Mercedes-Benz SLS AMG

You might have noticed some videos on this blog, and other blogs recently about Mercedes and Petronas, if you didn’t you can see all the previous videos here:

After the previous strange reports of alien abductions, and the video of a car being chased by drones – Petronas has revealed the next video in the series.

If you were the janitor, how could you resist taking this brand new, sleek Mercedes AMG-Petronas car for a ride? Watch the video to find out more.

The car looks like quite a beast too, 2.0-litre four-cylinder turbo-powered and enhanced with high-powered premium lubricant – right up my alley 馃槈 The ‘visitor’ even grabs a bottle of Petronas Syntium 7000.

The technology is so advanced, even other planets are willing to do anything to get their extraterrestrial hands on it.

Tags: , , , , , , , , ,

Continue Reading 1 CommentAdvertorial

Pom Pom Island – Sabah, Malaysia

What an amazing place! Pretty sure I’ll write about this trip (for once) because I had such a GOOD time!

Truly a paradise, crystal clear turquoise waters, amazing diving, great company, breathtaking sunsets – brilliant!

Pom Pom Island - Sabah, Malaysia

More soon.

Tags: , , , , , , , , , ,

Continue Reading No CommentsMalaysia, Trips & Travel