Welcome! Log In Create A New Profile

Advanced

Re: Use nginx to call shell script - simplest way?

agentzh
March 08, 2011 07:22AM
On Tue, Mar 8, 2011 at 8:07 PM, John Moore <grails@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
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Use nginx to call shell script - simplest way?

J2R March 08, 2011 07:12AM

Re: Use nginx to call shell script - simplest way?

agentzh March 08, 2011 07:22AM

Re: Use nginx to call shell script - simplest way?

J2R March 09, 2011 01:52PM

Re: Use nginx to call shell script - simplest way?

Richard Kearsley March 09, 2011 02:18PM

Re: Use nginx to call shell script - simplest way?

J2R March 09, 2011 03:48PM

Re: Use nginx to call shell script - simplest way?

agentzh March 09, 2011 10:42PM

Re: Use nginx to call shell script - simplest way?

agentzh March 09, 2011 10:56PM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

Elena Zwetkow March 10, 2011 03:20AM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

agentzh March 10, 2011 03:32AM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

Elena Zwetkow March 10, 2011 04:06AM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

agentzh March 10, 2011 04:36AM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

Alexander Kunz March 15, 2011 06:20PM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

agentzh March 15, 2011 10:32PM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

Alexander Kunz March 16, 2011 03:26AM

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

agentzh March 16, 2011 03:40AM

Re: Use nginx to call shell script - simplest way?

António P. P. Almeida March 08, 2011 02:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 60
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready