I need to leave running a Python script in a remote server. All OK so far. The problem is I need using virtualenv because I have no sudo privileges and I only can install and use pip packages using virtualenv. To ripple the curl, my script need a docker container running, so it's needed two terminals running.
I access through ssh and I can run it, but execution keeps attached to my terminals. I've tried using background execution but docker container ignore it and Python script stops when I close terminal. I also tried to put all my instructions (boot docker container, activate virtualenv and then run Python script) in a bash script but it neither works, I get the following error activating virtualenv:
source: not found
The question is: is there any way to leave my script running as daemon or service?
(There is no problem with privileges, I can ask admin for doing all needed steps)
Thanks in advance!
There are python-daemon and python-service packages that you may use to create python-based daemons and/or services.
Though I suppose it might be enough just to use nohup python path/to/script.py &.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With