Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So, I'm trying to execute a script on every request. I know how that sounds, this is for development environment.

I've added this to my nginx config access_by_lua_file "/opt/nginx/git-magic.lua";

git-magic.lua contains local status = os.execute('/opt/nginx/git-magic.sh')

And git-magic.sh contains: echo hello >> /tmp/git-magic

The issue is:

Whenever I hit any URL, I get the following in the nginx error log: 2012/09/27 15:35:48 [alert] 3241#0: waitpid() failed (10: No child processes)

Any ideas what I might be doing wrong?

share|improve this question
    
wow... I'm having the EXACT same problem, and thought I was going nuts... I'm looking hard to see if I can find an answer... –  user138906 Sep 28 '12 at 18:31
    
I am also having the same problem!! –  Sabya Oct 3 '12 at 14:16
    
Have you checked the obvious? Can nginx user access lua file? can nginx user write to /tmp/ ? –  c2h5oh Oct 3 '12 at 22:13
    
Lua can access git-magic.sh, git-magic.sh writes the right thing to /tmp/git-magic –  Andrei Serdeliuc Oct 3 '12 at 22:19
    
See if there's an apparmor.d file for nginx. I had a problem convincing dhcpd to run a file when an address is requested, because apparmor was blocking it. –  Tom O'Connor Oct 22 '12 at 11:54

1 Answer 1

The lua-resty-shell claims to solve this issue by supplying a non-blocking os.execute equivalent.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.