diff --git a/debian/postinst b/debian/postinst index fdb99a2..e92c369 100755 --- a/debian/postinst +++ b/debian/postinst @@ -8,14 +8,13 @@ if [ "$1" = configure ]; then adduser --system --quiet --home /nonexistent --no-create-home \ --shell /bin/false --force-badname --group --gecos "StatsD User" _statsd fi - - if [ -x "/etc/init.d/statsd" ]; then - update-rc.d statsd defaults >/dev/null - invoke-rc.d statsd start || exit $? - fi if ! dpkg-statoverride --list /var/run/statsd >/dev/null 2>&1; then dpkg-statoverride --update --add _statsd _statsd 0755 /var/run/statsd fi + if [ -x "/etc/init.d/statsd" ]; then + update-rc.d statsd defaults >/dev/null + invoke-rc.d statsd start || exit $? + fi fi diff --git a/debian/statsd.upstart b/debian/statsd.upstart index e007c25..7e480aa 100644 --- a/debian/statsd.upstart +++ b/debian/statsd.upstart @@ -15,5 +15,9 @@ setgid _statsd respawn respawn limit 10 5 -chdir /usr/share/statsd -exec /usr/bin/nodejs stats.js /etc/statsd/localConfig.js +script + NODE_BIN=$(which nodejs||which node) + chdir /usr/share/statsd + exec $NODE_BIN stats.js /etc/statsd/localConfig.js +end script +