Respawn httpd using init

How to auto restart httpd(apache) with inittab respawn?

I suppose since it is not done natively, its because there seem to be a good reason...

You could bypass my lack of collaboration on this point (/etc/inittab) by writing a job run by cron to check if httpd is there, and if not, warns you ... ( or restart...).

I suppose since it is not done natively, its because there seem to be a good reason...

Will u plz explain a bit....

I would check out Monit

Depending on exactly how initd is implemented, this inittab line might work, assuming you want httpd running in run levels 3, 4, and 5:

http:345:respawn:/path/to/httpd/startup/script

I'm assuming you're going to need a script to set up the proper environment. I'd also make sure the script either exec's the httpd, or waits for it to finish, because if the script process ends but leaves the httpd process running initd will probably start another copy of httpd.

You might also need to add some SIGTERM or SIGQUIT handling to your script if it doesn't exec the httpd process.