On Fri, 2008-11-14 at 10:25 -0500, Carolyn Beeton wrote:
> Woof's and Dale's comments intruiged me: the children (could) know when
> the supervisor is gone. What if one of them could restart the
> supervisor?
>
> So I wrote a process defn file and a script for a supervisor watcher.
> It is duly launched as a child process, but all it does is (in its
> script) read from stdin. If shut down properly, it never does anything.
> But if it returns from the read, then supervisor is gone: so it invokes
> /etc/init.d/sipxpbx restart. (I extended OsProcessLinux to create a
> stdin pipe).
>
> I can now demonstrate a successful automatic relaunch after a crash, or
> even even after "kill -9" of supervisor.
>
> Is this worth considering?
Yes, certainly, but two suggestions:
* Put in a delay of some seconds between detecting the parent
death and attempting the restart.
* Provide an external control switch that prevents the restart
(something like "if file /var/sipxdata/supervisor-disable
exists, then do not do the restart").
I've done auto-restart applications in the past, and under the right
(wrong) conditions they can quickly lock up the box if they restart too
quickly and then immediately crash (usually for the same reason the
original crashed). Together, those two mechanisms reduce the load the
crash/restart can cause and provide a way for a human to stop the cycle.
Excellent idea, Carolyn.
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev