Библиотека ansible плейбуков на разные случаи
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upstart-service.template.j2 708B

12345678910111213141516171819202122232425
  1. description "{{ service_description }}"
  2. start on runlevel [2345]
  3. stop on runlevel [!2345]
  4. expect fork
  5. kill timeout 60 # when upstart issued a stop, send SIGTERM, wait 60 sec before sending SIGKILL
  6. respawn
  7. respawn limit 5 30 #try 5 times within 60 seconds, or giveup
  8. script
  9. echo $$ > {{installation_path}}/app.pid
  10. exec {{ interpretator }} {{ installation_path}}/app.py
  11. end script
  12. pre-start script
  13. touch {{installation_path}}/app.log
  14. echo "\n[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> {{installation_path}}/app.log
  15. end script
  16. pre-stop script
  17. rm -f {{installation_path}}/app.pid
  18. echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> {{installation_path}}/app.log
  19. end script