2
給定以下目錄結構。永久使用監視文件重新啓動
# Currently in ~/myapp/current
tree
.
├── tmp
│ ├── restart.txt
│ ├── pids
├── log
│ ├── forever.log
├── myapp
│ ├── myapp.js
這工作。
sudo NODE_ENV=production forever \
-c "node --use_strict" \
--append \
-f \
-l ~/myapp/current/log/forever.log \
--pidFile ~/myapp/current/tmp/pids/myapp \
--uid myapp \
myapp/myapp.js
我希望能夠接觸文件,所以我嘗試使用--watch
參數重新啓動,直到永遠。我有一個名爲restart.txt
的空文件來觀看。不幸的是這個失敗:
sudo NODE_ENV=production forever \
-c "node --use_strict" \
--append \
-f \
-l ~/myapp/current/log/forever.log \
--pidFile ~/myapp/current/tmp/pids/myapp \
--uid myapp \
--watch tmp/restart.txt \
myapp/myapp.js
有了這個神祕的錯誤:
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
error: Could not read .foreverignore file.
error: ENOENT: no such file or directory, open '/home/deployer/myapp/releases/20151224185314/.foreverignore'
error: Forever detected script exited with code: 0
events.js:141
throw er; // Unhandled 'error' event
^
Error: watch /home/deployer/myapp/releases/20151224185314/node_modules/lodash/lang/isTypedArray.js ENOSPC
at exports._errnoException (util.js:855:11)
at FSWatcher.start (fs.js:1313:19)
at Object.fs.watch (fs.js:1341:11)
at createFsWatchInstance (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:82:15)
我已經嘗試了很多不同的路徑(絕對的,相對的,相對於--watchDirectory
等)的監視文件和我的不能讓它工作。怎麼了?