Guest User

Untitled

a guest
Nov 4th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. [Unit]
  2. Description=My App daemon
  3. After=network.target postgresql.service
  4. Wants=postgresql.service
  5.  
  6. [Service]
  7. EnvironmentFile=/etc/sysconfig/my-app
  8. WorkingDirectory=/opt/my-app/ # <- this is where your app lives
  9. User=root
  10. Group=root
  11. Type=simple
  12. ExecStart=/usr/bin/python server.py # <- this starts your app
  13. Restart=always
  14. RestartSec=5s
  15.  
  16. [Install]
  17. WantedBy=multi-user.target
  18.  
  19. DB_HOST=localhost
  20. DB_USER=postgres
  21. DB_PASSWORD=postgres
  22. DB_NAME=postgres
  23.  
  24. service my-app start
  25. service my-app stop
  26. service my-app restart
  27.  
  28. journalctl -u my-app -e
Add Comment
Please, Sign In to add comment