Well I posted yesterday about handing over the control of my webcams script and the Zoneminder viewer xlib_shm to a daemon manager, as it seemed the right way to go and I noticed earlier tonight that my 2nd machine has again crashed out on the xlib_shm.
First I did a search for the daemontools to get an idea of what it’s like, but alot of the postings were older. So then decided to do an ‘alternatives’ search which brought up a few results, only one of which mentioned upstart in ubuntu, hey presto! I’ve heard upstart before but never looked at it (at least I thought).
Did a bit of looking around and yep I remember reading that Ubuntu is moving away from the init.d scripts a while ago just never put it together with the word upstart.
Basically there’s new files in /etc/init/ which is what upstart looks at and their the configs for each service that’s starting on the machine. Funnily enough I remembered then where why I’d done some searching previously on /etc/init/ and it was for gdm.conf because the gdm kept launching even though I’d removed it with the update-rc.d -f gdm remove. I was trying to kill it off because it was grabbing the screen before xlib_shm could.
Anyway that’s a bit of a side track. Looking at some of the configs there and the FAQ it looks quiet powerful and will do exactly what I need.
I was going to jump straight in and make a new config for the webcams stuff, but then noticed you can have a service start on another, well that should be good I only want webcams starting if zoneminder is running so let’s check that config, oh no there isn’t one yet. After 2 mins of searching for a config some clever person has already made I’m going to call it a night and have a proper look tomorrow. but it got me thinking of moving more over to Upstart like my asterisk stuff that will also need and depend on dahdi.
You can also depend on having a filesystem and networking. I can see the filesystem being used for the zoneminder config and both being used for the webcams config. So I’m really looking forward to getting into this a bit too. There’s only a handful of occasions when asterisk has shutdown so not a huge problem, but when it has I did once get left with no phone line for 3 days cause I didn’t know it wasn’t running (obviously enjoying the peace and quiet too much). To solve this I have Nagios monitoring now and using event handlers to restart via the init.d script but handing over to Upstart really does seem the way forward. I’d still keep Nagios monitoring to ensure it’s running I can’t live without my nagios watching over everything.