Skip to content

Commit

Permalink
Cleaned up the Upstart script.
Browse files Browse the repository at this point in the history
  • Loading branch information
hectcastro committed Apr 13, 2012
1 parent fd08d3f commit 18f54d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
15 changes: 3 additions & 12 deletions recipes/default.rb
Expand Up @@ -23,21 +23,12 @@
notifies :restart, "service[statsd]"
end

directory "#{node["statsd"]["dir"]}/scripts" do
action :create
end

template "#{node["statsd"]["dir"]}/scripts/start" do
source "start.erb"
mode 0755
variables(
:log_file => node["statsd"]["log_file"]
)
end

template "/etc/init/statsd.conf" do
mode "0644"
source "statsd.conf.erb"
variables(
:log_file => node["statsd"]["log_file"]
)
end

user "statsd" do
Expand Down
4 changes: 0 additions & 4 deletions templates/default/start.erb

This file was deleted.

15 changes: 8 additions & 7 deletions templates/default/statsd.conf.erb
@@ -1,11 +1,12 @@
description "statsd"
description "StatsD"
author "Chef"

start on startup
stop on shutdown
start on runlevel [2345]
stop on runlevel [!2345]

script
export HOME="/root"
respawn
expect daemon

exec sudo -u statsd /usr/share/statsd/scripts/start
end script
exec start-stop-daemon --start --oknodo --chdir /usr/share/statsd --user statsd --chuid statsd --name statsd --startas /usr/local/bin/node --background -- /usr/share/statsd/stats.js /etc/statsd/config.js 2>&1 >> <%= @log_file %>

emits statsd-running

0 comments on commit 18f54d7

Please sign in to comment.