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:

example supervisord.conf:

[program:myserver]
command=/your/server/command
process_name=%(program_name)s
numprocs=1
autostart=true
autorestart=true
priority=888
user=mikko

[program:mycheck]
command=/your/check.sh
process_name=%(program_name)s
numprocs=1
directory=/tmp
umask=022
priority=999
autostart=true
autorestart=true
user=mikko

example /your/check.sh:

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

On Fri, Feb 6, 2015 at 3:49 AM, Mikko Ohtamaa <mi...@redinnovation.com>
wrote:

> Hi,
>
> I'd like to perform a HTTP POST request to a process under supervisord
> control. If the HTTP POST times out, or returns bad response, the process
> is restarted by supervisord.
>
> This would be like httpok superlance module, but with some more logic -
> enable HTTP POST and post payload.
>
> The easiest option I was thinking would be just run a arbitrary shell
> script command and based on the exit code of this script make the
> supervisord to restart the process. In my case the shell script would use
> curl + some logic to make the HTTP POST.
>
> However I did not found any examples of supervisord and shell script
> checks. Do supervisord have support for them? Any alternatives for my use
> case?
>
>
> --
> Mikko Ohtamaa
> http://opensourcehacker.com
> http://twitter.com/moo9000
>
>
> _______________________________________________
> Supervisor-users mailing list
> Supervisor-users@lists.supervisord.org
> https://lists.supervisord.org/mailman/listinfo/supervisor-users
>
>

-- 

This e-mail, including attachments, contains confidential and/or 
proprietary information, and may be used only by the person or entity to 
which it is addressed. The reader is hereby notified that any 
dissemination, distribution or copying of this e-mail is prohibited. If you 
have received this e-mail in error, please notify the sender by replying to 
this message and delete this e-mail immediately.
_______________________________________________
Supervisor-users mailing list
Supervisor-users@lists.supervisord.org
https://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to