/etc/init.d/script, or /etc/inittab – respawn on die

daemoninitinit-scriptsysvinit

I have a daemon/service (milter-regex), that is dying. I'm only using it temporarily (A few months), so don't care too much, but I want it to restart when it dies.

It is an init.d script. 'service milter-regex start' etc. The init script lives at /etc/init.d/milter-regex

I know if I have something in /etc/inittab, it will automagically respawn if it dies. Are init scripts supposed to do this as well, or do I need to put it in inittab?

It could be failing to restart as it isn't cleaning up a stale sock file, which I will fix today, but thought I'd ask the question anyway.

Running on RHEL4 (Yes, old)

Thanks, Brock

Best Answer

Scripts in init.d don't get rerun automatically when the service crashes. If you want to do the minimum amount of work to make sure it runs, inittab may be your best bet. It's icky though, almost as icky as still running RHEL 4.