Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
platform-family is not enough, we need to specify the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko Caldara committed Oct 7, 2014
1 parent 441cabe commit 64d643c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions templates/amazon/upstart.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# statsd - Network daemon for aggregating statistics
#
# This is a network service that receives metric data via UDP from other
# applications. It aggregates this data and flushes it to a storage backend
# (typically Graphite) at regular intervals.
#
description "Network daemon for aggregating statistics"
author "Librato"

start on (local-filesystems and net-device-up IFACE!=lo)

respawn
respawn limit 10 5

chdir <%= node['statsd']['path'] %>

pre-start script
NODE_BIN=$(which nodejs || which node)
[ -n $NODE_BIN ] || { stop; exit 0; }
end script

script
NODE_BIN=$(which nodejs || which node)
su -s /bin/sh -c 'exec "$0" "$@"' <%= node['statsd']['user'] %> -- $NODE_BIN stats.js <%= node['statsd']['config_dir'] %>/config.js 2>&1 >> <%= node['statsd']['log_file'] %>
end script

0 comments on commit 64d643c

Please sign in to comment.