diff --git a/templates/gunicorn-instance.service.erb b/templates/gunicorn-instance.service.erb index f810fb8..bf34389 100644 --- a/templates/gunicorn-instance.service.erb +++ b/templates/gunicorn-instance.service.erb @@ -1,24 +1,27 @@ # File managed by puppet (class gunicorn::instance <%= @name %>), changes will be lost [Unit] Description=Gunicorn instance <%= @name %> ConditionPathExists=/etc/gunicorn/instances/<%= @name %>.cfg PartOf=gunicorn.service ReloadPropagatedFrom=gunicorn.service Before=gunicorn.service [Service] User=<%= @user %> Group=<%= @group %> PIDFile=<%= @runtime_dir %>/pidfile RuntimeDirectory=<%= @runtime_dir %> WorkingDirectory=<%= @working_dir_override %> <% @environment.each do |key, value| -%> Environment=<%= key %>=<%= value %> <% end -%> ExecStart=/usr/bin/gunicorn3 -p <%= @runtime_dir %>/pidfile -c <%= @config_file %> <%= @executable %> ExecStop=/bin/kill -TERM $MAINPID ExecReload=/bin/kill -HUP $MAINPID +Restart=always +RestartSec=10 + [Install] WantedBy=multi-user.target