Check and start a process in Linux
Over the past few days, we realised that, for various reasons, our Sphinx search process (searchd) would occasionally not be running. As Sphinx is pretty much the backbone of our sites, we couldn't have this happening. I wrote a small script that runs permanently, checks if searchd.pid exists (you can have it check anything) and if not, then starts searchd. This is all done in a screen session so I can just leave it running.
The script is very, very simple;
while [ "1 -eq 1" ]
do
if [ ! -e "/var/log/searchd.pid" ]
then
searchd
fi
sleep 2
done
Basically, we have an infinite loop, we check that /var/log/search.pid exists, if not, start it, then sleep ('pause' essentially) for 2 seconds before starting again. You can change it to alert you too, if you'd like.
To get an idea of how screen works, check out this post.
Thought it might help some of you.
Toto – Rosanna – Best film clip ever?
Inspired by a mate of mine who emailed me a link to Toto's Rosanna film clip, I tried to think of the three greatest film clips of all time and I got these three;
Toto - Rosanna. Cant argue. Toto still remain one of the greatest bands of all time.
Men at Work - Land Downunder. Great because they had the smallest budget ever and still managed to make the song and clip great.
Dexy's Midnight Runners - Come on Eileen. What kind of name is Eileen anyway? These guys are a touch odd and took the bad 80s hair to a whole new level.
Blog Action Day 2008
With already over 200 sites registered and over half a million readers, BAD2008 is going to be huge.
I personally will be writing a post for this event and I encourage all other bloggers to take part also.
Bike Thief
Crazy video of a guy stealing his own bike in broad daylight. Make sure you watch it til at least the third 'method'.
This is the kind of thing movies are made of
Scary Stuff.
The torch through Canberra.
One of my Heroes, Bob Brown, had a sky writer write 'Free Tibet' across the sky during the run.
More info here.
And, according to this article, this might be the last time the torch comes to Australia. I dont believe that for a moment and it is just a scare tactic to get people to calm down. Why should they calm down? Since when has voicing your opinions been something to be threatened about? (ok, since, like, forever...).
Now a nice and easy way to reduce your PC’s power consumption
Japanese Whaling Quota damage
Whales: The Japanese whaling fleet returned to port short of their quota by nearly
half, and blamed environmentalists for disrupting the hunt. We should all
be proud of the role we played in saving 439 whales when our ship the
Esperanza pursued the Nisshin Maru for 15 days across 4,300 miles of the
Antarctic whale sanctuary, shutting down the whole whaling operation for the
entirety of the epic chase.
Thats brilliant. An extra 500 whales for our oceans for another 9 months or so.
Thanks Greenpeace, Sea Shephard and anyone else involved in this!
Another act of brilliance from Sea Shepherd.
The bloody Canadians and their annual seal hunt is an absolute barbaric travesty that nobody seems to care about.
Except Sea Shepherd.
