From 64d643c0d5fc8f9d80ed79e753b1963f318058bb Mon Sep 17 00:00:00 2001 From: Mikko Caldara Date: Tue, 7 Oct 2014 10:22:37 +0100 Subject: [PATCH] platform-family is not enough, we need to specify the platform --- templates/amazon/upstart.conf.erb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 templates/amazon/upstart.conf.erb diff --git a/templates/amazon/upstart.conf.erb b/templates/amazon/upstart.conf.erb new file mode 100644 index 0000000..34e9ba8 --- /dev/null +++ b/templates/amazon/upstart.conf.erb @@ -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