Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.1k stars 2.6k forks source link

PM2 Watch is constantly restarting - "Change detected on path..." - Cronjob for folder rights #5625

Open hermify opened 1 year ago

hermify commented 1 year ago

pm2: 5.1.2 node: v16.13.1 Rocky Linux release 8.7 (Green Obsidian)

Problem: pm2 is constantly restarting the nodejs application every minute. I saved a file inside a subfolder with VS Code and Transmit (FTP Software) one hour ago.

Change detected on path /css-js/Chart.min.js for app nodejs_application - restarting PM2 | Stopping app:nodejs_application id:16

Cause: We have a cronjob, that is fixing folder rights * * * * * chown shop_user:sftponly -R /usr/local/www/node_application/*

Config - pm2-process.json: { "script": "index.js", "watch": true, "ignore_watch": ["log",".git",".ssh","node_modules"], "watch_delay": 1000, "watch_options": { "followSymlinks": false }, "name": "node_application" }

Question: Can I exclude watching the file users and rights? Why is there a change detected, if the owner and rights of a file has been adjusted once with this cronjob? The chown should only adjust it once.

alihamza1214 commented 1 year ago

any luck in fixing this issue? I am getting same issue that my apps are restarting whenever I am trying to download a file