

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
27 messages in ru.sysoev.nginxRe: Feature request: Run a script whe...| From | Sent On | Attachments |
|---|---|---|
| Rt Ibmer | Apr 28, 2008 8:44 am | |
| Cliff Wells | Apr 28, 2008 10:20 am | |
| mike | Apr 28, 2008 11:53 am | |
| Rt Ibmer | Apr 28, 2008 2:02 pm | |
| Cliff Wells | Apr 28, 2008 2:18 pm | |
| Manlio Perillo | Apr 28, 2008 2:37 pm | |
| Rt Ibmer | Apr 28, 2008 6:10 pm | |
| Rt Ibmer | Apr 28, 2008 6:19 pm | |
| Manlio Perillo | Apr 29, 2008 1:18 am | |
| Manlio Perillo | Apr 29, 2008 1:25 am | |
| Rt Ibmer | Apr 29, 2008 8:11 am | |
| François Battail | Apr 29, 2008 10:46 am | |
| Rt Ibmer | Apr 29, 2008 1:41 pm | |
| Manlio Perillo | Apr 29, 2008 1:57 pm | |
| François Battail | Apr 29, 2008 2:27 pm | |
| Aleksandar Lazic | Apr 29, 2008 2:36 pm | |
| François Battail | Apr 29, 2008 11:20 pm | |
| Mansoor Peerbhoy | Apr 30, 2008 1:46 am | |
| Manlio Perillo | Apr 30, 2008 2:36 am | |
| François Battail | Apr 30, 2008 3:54 am | |
| Mansoor Peerbhoy | Apr 30, 2008 5:03 am | |
| Grzegorz Nosek | Apr 30, 2008 5:18 am | |
| Cliff Wells | Apr 30, 2008 10:40 am | |
| Manlio Perillo | Apr 30, 2008 12:16 pm | |
| Manlio Perillo | May 1, 2008 2:42 am | |
| Grzegorz Nosek | May 1, 2008 11:28 am | |
| Manlio Perillo | May 1, 2008 12:02 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Feature request: Run a script when upstream detected down/up | Actions... |
|---|---|---|
| From: | Manlio Perillo (manl...@public.gmane.org) | |
| Date: | Apr 29, 2008 1:25:46 am | |
| List: | ru.sysoev.nginx | |
Rt Ibmer ha scritto:
Except that Nginx is asynchronous, not threaded. This means that when your script is called, Nginx will now be delayed while the script is launched (and what if the script fails?).
Nginx will just have to wait until fork returns.
I don't know much about this stuff, but isn't there a way to fork something as a
background process? Something equivalent to me typing "./my_failover_script &" ?
So assuming nginx could simply make a shell system call or somehow make the call
but tell it to run in the background, then I imagine the nginx thread that would
call out to run the script would return almost immediately. At any rate, even
if it took a little time, this should be a rare event, like maybe once every few
weeks if things are running smoothly.
And if it can't be launched as a background process, I would simply make the
script it calls do something like flag another process to run, and then exit
immediately so the thread returned quickly. The main thing is that I just need
nginx to signal me somehow when it takes an upstream server out of rotation.
Doing this by sniffing the log file is a hack at best.
There are no problems at spawing an external process. Simply, Nginx does not directly support this and you will get a lot of NOTICE messages in the log when each process exits (even if it exits with a success status code).
For the OP, executing a script when a backend fails is trivial, it should be possibile to do it just be adding a new module.
Yes I had a look at the tutorial on building modules. Unfortunately it is over
my head. This is why I am hopeful that the developers will recognize the
importance of such a "hook" to an external monitoring system would be very
useful especially if it is straight-forward to do. Thank you.
Personally I'm not interested in this feature, sorry. I have given a look in the Nginx source code and it seems that all you want is implementable, and it should require only a few hours of coding.
Regards Manlio Perillo







