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/fastcgi-php.pid'
[06:02:25] error : monit: Error reading pid from file '/var/run/fastcgi-php.pid'
[06:02:26] error : monit: Error reading pid from file '/var/run/fastcgi-php.pid'
[06:02:27] error : monit: Error reading pid from file '/var/run/fastcgi-php.pid'
[06:02:28] error : monit: Error reading pid from file '/var/run/fastcgi-php.pid'
[06:02:29] error : monit: Error reading pid from file '/var/run/fastcgi-php.pid'

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/fastcgi-php.pid
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 fastcgi-php.pid with path /var/run/fastcgi-php.pid
if size = 0 then
exec "/bin/rm /var/run/fastcgi-php.pid"
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 : 'fastcgi-php.pid' size test failed for /var/run/fastcgi-php.pid -- current size is 0 B
[11:21:39] info : 'fastcgi-php.pid' exec: /bin/rm
[11:23:39] error : 'fastcgi-php.pid' file doesn't exist
[11:23:39] info : 'fastcgi-php.pid' trying to restart
[11:23:39] info : 'fastcgi-php.pid' stop: /etc/init.d/php5-fcgi
[11:23:39] info : 'fastcgi-php.pid' start: /etc/init.d/php5-fcgi
[11:25:39] info : 'fastcgi-php.pid' file exist
[11:25:39] info : 'fastcgi-php.pid' 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 馃檪

Wedding

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

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.

LOLwut

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

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

Best Vadering Picture EVAR!!111onetyone

Best.Vadering.Picture.Evar.

Best Vadering Picture

Created by me and most of the Tech Team on Langkawi Berjaya Resort beach at our team retreat last week.

We did an Iron Man one too, but it was out of focus or something.

You might remember, recently there have been a few videos going around of strange sightings in Stuttgart. The latest video reveals the whole liquid and metal concept with an awesome collaboration car built by AMG & Petronas.

Nice looking ride I must say.

Tags: , , ,

Continue Reading No CommentsWeird/Humour

The Vendor Client Relationship – In Real Life Situations

So true, so good – and sadly, happens so much.

I get this kind of stuff so much during freelance projects it’s ridiculous.

Don’t be that client (agencies are ESPECIALLY bad at this).

Like one that assumed because I’m a blogger, I’d give my pictures away for free (or near enough) for a commercial ad campaign.

When I e-mailed them with a reasonbly cheap quote, they never even had the decency to e-mail me back with a rejection – or anything at all. Pretty disgusting, and prior to me e-mailing the quote, the girl had the gaul to call me and hassle me about using my pictures on a Sunday morning.

Respect people’s time & privacy, from her tone she was basically requesting permission to use my pics without expecting me to ask for payment. And it wasn’t a small agency, for anyone that’s interested it was GroupM.

For the record, ‘exposure’ isn’t worth diddly squat – I’ve been down that road before and all it leads to is more people who want shit for free. Here’s another good one on that topic:

If you want some kinda guidance, you can check out this natty flow chart thing – https://shouldiworkforfree.com/

So yah, don’t be that client 馃檪

Tags: , , , , , , , ,

Continue Reading No CommentsSerious Issues