I would have process create a pidfile on start and delete it on exit.

That way if the process doesn't exit successfully the pidfile will be there
but the curl test will fail

Regards

On Fri Feb 06 2015 at 3:48:19 PM Mikko Ohtamaa <mi...@redinnovation.com>
wrote:

> Hi,
>
>
> If you're going to have a single server process command and a single
>> check, then you could just have supervisor keep both running and use a
>> shell script for the check. Something like this:
>>
>>
>>
> Thanks for the answer! One more question - what would be the correct way
> to check if the process myserver has been intentionally stopped (e.g. it is
> not in running state according to supervisorctl) - as this functionality is
> what httpok module provides also. It does not try to restart processes
> which have been taken down intentionally (e.g. for the duration of
> migration). Or does the config already do it somehow - and I don't manage
> to spot it?
>
> while 1; do
> if curl -f -X POST --connect-timeout=1 -m 1 -d 'post body'
> http://localhost/check
> then
>     sleep 60
> else
>     supervisorctl restart myserver
>     sleep 60
> fi
>
>
>
> ...
>  _______________________________________________
> Supervisor-users mailing list
> Supervisor-users@lists.supervisord.org
> https://lists.supervisord.org/mailman/listinfo/supervisor-users
>
_______________________________________________
Supervisor-users mailing list
Supervisor-users@lists.supervisord.org
https://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to