On Friday, May 24, 2019 at 11:13:22 AM UTC-7, lucas wrote:
>
> hello one and all,
>
> ok, using python 2.7 and web2py 2.18.5 on centos or raspbian linux.  is 
> there a way to start a python script file, a file that runs python all on 
> its own from the command line interface, and start or spawn it under a 
> web2py controller function, have web2py immediately, completely, and safely 
> release from the running script, allow the script to continue to run, and 
> then just return whatever html back to the user?  so the script will still 
> be running even after the controller does its response and such.  and I 
> wouldn't mind during the spawning process would return the pid when its 
> originally spawned so I can kill it later on.
>
> I guessing I would use subprocess.Popen but I can't seem to get web2py to 
> immediately return and I would like verification that doing this won't hurt 
> the multiprocessing or threads, or create some kind of instability in 
> web2py or the server, or any of that kind of mess like that.
>
> thank you in advance, Lucas
>
>
>
Why do you need web2py to launch the script?  Is this something that should 
be running forever?  I'd look at the Rasbian startup tools (is that systemd 
in that environment?).  If it has to start in response to a request, but 
run for donkey's years after that, I'd look at having the front end take 
care of it (I think you said Nginx in another thread; with uwsgi?).  
Otherwise, I'd make it a scheduler task, and set the timeout as a big 
number.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/556150cc-dd37-47bc-9926-29c2bae941d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to