-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Child process not detached #40
Comments
Off the top of my head, try closing stdin, stdout and stderr in the child process, probably something like:
Of course this means you won't be able to produce any more content from the background script but you don't really have a place to send it to anyway (you might get away with closing stdout only and keep logging to stderr but you'd have to check it) |
Your solution worked!
makes the child to be detached.
You can even specify a file where to redirect the stdout or stderr of the child:
but you must always specify a redirection for 1 and for 2. If one of the two redirections is missing, the child process is not detached. |
@cescp : Is there any reason why this issue is still open? What do you expect that fcgiwrap project to do about it? - If nothing, kindly close. |
I'm trying to do the following: when a request is received, an immediate response 202 should be given, while a long background process is started.
In nginx.conf:
/usr/local/bin/do-something.sh
/usr/local/bin/do-process.sh
The expected result is that ampersand used in calling do-process.sh should detach the child process, and 202 code should be returned immediately, as when calling /usr/local/bin/do-something.sh from console. But when I make a request via nginx:
the response is not given immediately, but after 10 seconds.
I'm using spawn with config /etc/sysconfig/spawn-fcgi:
in a CentOS 7 computer.
Is this the right way of calling a process and start a child process without waiting it to finish?
The text was updated successfully, but these errors were encountered: