I need to manually create auto-respawning for lighttpd & MySQL to make sure it running all time
But what is the code to put in
Oh, I hate myself for saying this, but have you looked at daemontools by DJB? ( http://cr.yp.to/daemontools.html ) They do what you want. But why do you want to do it like that?
Are you having some sort of problem where your daemons die? Can't we fix the problem, rather than continually respawn them?