Skip to content
Browse files

Replace runit dependency with upstart

  • Loading branch information...
1 parent fdf3e18 commit dca48726f945a9ddb29b91fee4886981dc77d408 @realityforge committed
View
1 README.md
@@ -14,7 +14,6 @@ Requirements
## Cookbooks
* build-essentials
- * runit
Attributes
==========
View
1 metadata.rb
@@ -6,7 +6,6 @@
version "0.0.2"
depends "build-essential"
-depends "runit"
depends "graphite"
depends "unicorn"
View
11 recipes/default.rb
@@ -98,5 +98,14 @@
group 'root'
end
-runit_service "gdash"
+template "/etc/init/gdash.conf" do
+ source "gdash-upstart.conf.erb"
+ mode "0644"
+ cookbook 'gdash'
+end
+service "gdash" do
+ provider Chef::Provider::Service::Upstart
+ supports :start => true, :restart => true, :stop => true, :status => true
+ action [:enable, :start]
+end
View
20 templates/default/gdash-upstart.conf.erb
@@ -0,0 +1,20 @@
+#
+# Generated by Chef
+#
+# gdash - GDash server
+#
+description "GDash Dashboard"
+
+start on filesystem or runlevel [2345]
+stop on runlevel [!2345]
+
+setuid <%= node['gdash']['owner'] %>
+setgid <%= node['gdash']['group'] %>
+
+pre-start script
+ test -x <%= node.gdash.base %>/bin/unicorn || { stop; exit 0; }
+end script
+
+env RACK_ENV=production
+
+exec <%= node.gdash.base %>/bin/unicorn -c /etc/unicorn/gdash.app config.ru --env production
View
2 templates/default/sv-gdash-log-run.erb
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec svlogd -tt ./main
View
5 templates/default/sv-gdash-run.erb
@@ -1,5 +0,0 @@
-#!/bin/sh
-exec 2>&1
-cd <%= node.gdash.base %>
-export RACK_ENV=<%= node.chef_environment %>
-exec chpst -u www-data:www-data -l <%= node.gdash.base %>/lock -- bin/unicorn -c /etc/unicorn/gdash.app config.ru --env <%= node.chef_environment %>

0 comments on commit dca4872

Please sign in to comment.
Something went wrong with that request. Please try again.