Skip to content
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

Any way to detach executed process? #70

Open
vegetablesalad opened this issue Feb 5, 2021 · 1 comment
Open

Any way to detach executed process? #70

vegetablesalad opened this issue Feb 5, 2021 · 1 comment
Labels

Comments

@vegetablesalad
Copy link

It seems that shell2http waits for any child process that is spawned to finish.
For example if your un script.py that will spawn another child process script2.py and exits, it will still wait for script2.py to finish. Even thou _script.py has exited. I have tried using & and & disown when starting the script it still seems to be attached to the process and every child process.

@msoap
Copy link
Owner

msoap commented Feb 6, 2021

You can try using nohup command, like this:

shell2http /cmd 'nohup script.py & echo ok'

this will still block the http-request, but nevertheless your process will continue to run in the background.

For me, it worked that command:

shell2http /date 'nohup sh -c "while true; do sleep 1; date > ~/tmp/date.txt; done" & echo ok'

In the future I will probably add an option for the command, which would indicate that this command is "background", because the processing of the output of such a command will be different, and cannot be determined from the command text.

Note for me: for background commands it can be use osExecCommand.Process.Release()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants