| From | Sent On | Attachments |
|---|---|---|
| John Moore | Mar 8, 2011 4:07 am | |
| agentzh | Mar 8, 2011 4:19 am | |
| António P. P. Almeida | Mar 8, 2011 10:59 am | |
| John Moore | Mar 9, 2011 10:42 am | |
| Richard Kearsley | Mar 9, 2011 11:15 am | |
| John Moore | Mar 9, 2011 12:39 pm | |
| agentzh | Mar 9, 2011 7:38 pm | |
| agentzh | Mar 9, 2011 7:52 pm | |
| Elena Zwetkow | Mar 10, 2011 12:16 am | |
| agentzh | Mar 10, 2011 12:28 am | |
| Elena Zwetkow | Mar 10, 2011 1:01 am | |
| agentzh | Mar 10, 2011 1:33 am | |
| Alexander Kunz | Mar 15, 2011 3:14 pm | |
| agentzh | Mar 15, 2011 7:28 pm | |
| Alexander Kunz | Mar 16, 2011 12:22 am | |
| agentzh | Mar 16, 2011 12:36 am |
| Subject: | Re: Use nginx to call shell script - simplest way? | |
|---|---|---|
| From: | agentzh (agen...@gmail.com) | |
| Date: | Mar 8, 2011 4:19:05 am | |
| List: | ru.sysoev.nginx | |
On Tue, Mar 8, 2011 at 8:07 PM, John Moore <gra...@jmsd.co.uk> wrote:
I have a Java web application which, once in a while for reasons I am trying to determine, sometimes becomes unresponsive. I want to give users a simple way of restarting it, via the web, so as I've used ngix a lot in the past, my first thoughts turned to having nginx running on another port, with a URL available which causes a shell script to be run. What would be the easiest, most lightweight, way to do this? Or is there some other way of effecting what I want which I haven't thought of yet?
Using ngx_lua [1]:
location /restart-java-app { content_by_lua 'os.execute("/bin/restart-my-java-app")'; }
But it's blocking, only suitable for personal use ;)
IIRC, Marcus Clyne was working on ngx_shell or something like that? Which can give you shell access based on asynchronous threads that will not block the whole nginx worker process :)
BTW, it's recommended to use the ngx_openresty bundle rather than compile the module yourself: https://github.com/agentzh/ngx_openresty
Cheers, -agentzh
[1] ngx_lua: http://github.com/chaoslawful/lua-nginx-module
_______________________________________________ nginx mailing list ngi...@nginx.org http://nginx.org/mailman/listinfo/nginx





