I have Python script bgservice.py
and I want it to run all the time, because it is part of the web service I build. How can I make it run continuously even after I logout SSH?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You could also use GNU screen which just about every Linux/Unix system should have.
If you are on Ubuntu/Debian, its enhanced variant byobu is rather nice too.
The zsh shell has an option to make all background processes run with nohup.
In
~/.zshrc
add the lines:Then you just need to run a process like so:
python bgservice.py &
, and you no longer need to use the nohup command.I know not many people use zsh, but it's a really cool shell which I would recommend.