From 6a6c37c2cf47b80baff26af5ba19e968d6a71a6c Mon Sep 17 00:00:00 2001 From: e0d Date: Wed, 13 Feb 2013 08:15:50 -0500 Subject: [PATCH 1/2] removing the restart commands from gunicorn service script in favor of packagedata.yaml --- templates/gunicorn/gunicorn.conf.erb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/gunicorn/gunicorn.conf.erb b/templates/gunicorn/gunicorn.conf.erb index f04ada38..8757f7bf 100644 --- a/templates/gunicorn/gunicorn.conf.erb +++ b/templates/gunicorn/gunicorn.conf.erb @@ -29,10 +29,11 @@ env LANG=en_US.UTF-8 env DJANGO_SETTINGS_MODULE=<%= scope.lookupvar('settings_module') %> env SERVICE_VARIANT="<%= scope.lookupvar('title') %>" -<% if scope.lookupvar('stacked') == false -%> +<% if pre_start_commands.length > 0 -%> pre-start script - find ${package_root} -user ${user} -type f -name '*.pyc' -delete || true - find /tmp -user ${user} -type d -name tmp*mako -exec rm -rf {} \\; || true +<% pre_start_commands.each do |command| -%> + <%= command %> +<% end -%> end script <% end -%> From 9ca5063dadfe3820fe37c87d9b63c3bda3d46894 Mon Sep 17 00:00:00 2001 From: e0d Date: Wed, 13 Feb 2013 11:25:13 -0500 Subject: [PATCH 2/2] removing prestart command logic --- templates/gunicorn/gunicorn.conf.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/templates/gunicorn/gunicorn.conf.erb b/templates/gunicorn/gunicorn.conf.erb index 8757f7bf..50b4bd14 100644 --- a/templates/gunicorn/gunicorn.conf.erb +++ b/templates/gunicorn/gunicorn.conf.erb @@ -29,14 +29,6 @@ env LANG=en_US.UTF-8 env DJANGO_SETTINGS_MODULE=<%= scope.lookupvar('settings_module') %> env SERVICE_VARIANT="<%= scope.lookupvar('title') %>" -<% if pre_start_commands.length > 0 -%> -pre-start script -<% pre_start_commands.each do |command| -%> - <%= command %> -<% end -%> -end script -<% end -%> - chdir <%= scope.lookupvar('package_root') %> <% if scope.lookupvar('app_interface') != 'python' -%> setuid <%= scope.lookupvar('user') %>