Библиотека 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.

25 lines
708 B

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