Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. python: how to write daemon in Linux
  2. respawn
  3.  
  4. respawn limit 5 300
  5.  
  6. exec python /path/to/a.py
  7.        
  8. nohup python a.py &
  9.        
  10. $ screen
  11.        
  12. $ screen -S backup
  13.        
  14. Ctrl+a d command (press and hold Ctrl, press and hold a, then press d) to detach from the session.
  15.        
  16. $ screen -ls
  17.        
  18. $ screen -R
  19.        
  20. ctrl+a d - detach the screen, and let it run without user interface (as described above)
  21. ctrl+a c - create a new terminal
  22. ctrl+a A - set the name of the current terminal
  23. ctrl+a n - switch to next terminal
  24. ctrl+a p - switch to prev terminal
  25. ctrl+a " - list the of terminals