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

Commit

Permalink
Merge pull request #28 from david-richer-adsk/support-centos-6
Browse files Browse the repository at this point in the history
Add support for centos 6.x
  • Loading branch information
mheffner committed Jul 31, 2014
2 parents 88bd2f2 + b5b34b9 commit e16f426
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ provisioner:

platforms:
- name: ubuntu-12.04
- name: centos-6.5

suites:
- name: default
Expand Down
1 change: 1 addition & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
depends 'nodejs', '>= 0.5.2'

supports 'ubuntu'
supports 'centos', '~> 6.0'
25 changes: 25 additions & 0 deletions templates/centos-6/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
3 changes: 2 additions & 1 deletion test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require 'serverspec'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS
# Force Debian to properly detect statsd service for upstart on CentOS 6.
include Serverspec::Helper::Debian

RSpec.configure do |c|
c.before :all do
Expand Down

0 comments on commit e16f426

Please sign in to comment.