Permalink
Browse files

autodetect node.js binary ubuntu and/or debian change the path to nod…

…ejs from /usr/bin/nodejs to /usr/bin/node between maverick and natty
  • Loading branch information...
Bruno Clermont authored and kastner committed Sep 2, 2011
1 parent 15d147b commit f82efdb450f5178c7ff9224815cbe393b733b2c2
Showing with 11 additions and 2 deletions.
  1. +11 −2 debian/scripts/start
View
@@ -1,3 +1,12 @@
#!/bin/sh
-# Called by Upstart, /etc/init/statsd.conf
-/usr/bin/nodejs /usr/share/statsd/stats.js /etc/statsd/rdioConfig.js 2>&1 >> /var/log/statsd/statsd.log
+
+if [ -x /usr/bin/nodejs ]; then
+ NODE_BIN=/usr/bin/nodejs
+elif [ -x /usr/bin/node ]; then
+ NODE_BIN=/usr/bin/node
+else
+ echo "Can't find /usr/bin/nodejs or /usr/bin/node"
+ exit 1
+fi
+
+$NODE_BIN /usr/share/statsd/stats.js /etc/statsd/rdioConfig.js 2>&1 >> /var/log/statsd/statsd.log

0 comments on commit f82efdb

Please sign in to comment.