【发布时间】:2015-04-11 19:17:29
【问题描述】:
我的 pm2 有问题。 我的开始 json 是
{
"apps" : [{
"name" : "sails",
"script" : "app.js",
"log_date_format" : "DD-MM-YYYY HH:mm Z",
"ignoreWatch" : ["[\\/\\\\]\\./", "node_modules", ".tmp", "views", "assets", ".idea"],
"watch" : true
}]
}
那我做
pm2 start dev.json
PM2 在此消息中无限重启
PM2: 2015-02-11 14:56:39: Change detected for app name: sails - restarting
PM2: 2015-02-11 14:56:39: Process with pid 5766 still not killed, retrying...
PM2: 2015-02-11 14:56:39: App closed with code: 0
PM2: 2015-02-11 14:56:39: App name:sails id:0 exited
PM2: 2015-02-11 14:56:40: Process with pid 5766 killed
PM2: 2015-02-11 14:56:40: Starting execution sequence in -fork mode- for app name:sails id:0
PM2: 2015-02-11 14:56:40: App name:sails id:0 online
但是没有文件被更改。在sails 注销调试消息后,似乎是PM2 重新启动。有什么想法吗?
【问题讨论】:
-
同一文件夹中是否有日志文件写入?尝试知道哪些文件正在更改并将它们添加到
ignoreWatch属性中 -
请注意,Sails 在生产环境中运行时还会创建一个 www 文件夹...您可能也希望将其添加到忽略列表中。