我在/ etc / init目录中使用以下statsd.conf文件(和sudo start statsd)来启动statsd。当我运行sudo start statsd时,我收到conf文件下面发布的错误。任何有关如何解决/解决此问题的想法将不胜感激。
/etc/init/statsd.conf
#!upstart
description "Statsd node.js server"
start on startup
stop on shutdown
script
export HOME="/root"
echo $$ > /var/run/statsd.pid
exec sudo -u www-data node /home/username/anotherDir/statsd/stats.js /home/userName/anotherDir/statsd/localConfig.js >> /var/log/statsd.log 2> /var/log/statsd.error.log
end script
pre-start script
# Date format same as (new Date()).toISOString() for consistency
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/statsd.log
end script
pre-stop script
rm /var/run/statsd.pid
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/statsd.log
end script
错误消息:
fs.js:1051
throw errnoException(process._errno, 'watch');
^
Error: watch ENOENT
at errnoException (fs.js:1019:11)
at FSWatcher.start (fs.js:1051:11)
at Object.fs.watch (fs.js:1076:11)
at new Configurator (/home/username/anotherDir/statsd/lib/config.js:26:6)
at Object.exports.configFile (/home/username/anotherDir/statsd/lib/config.js:36:16)
at Object.<anonymous> (/home/username/anotherDir/statsd/stats.js:146:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
答案 0 :(得分:3)
错误ENOENT
是由file not found引起的。我会仔细检查你的stats.js
脚本
答案 1 :(得分:1)
导航错误 - 配置文件名为config.js而不是localConfig.js。