Running on Ubuntu, latest versions for everything including pm2.
I have my main user "ubuntu" with full access via ssh, a user "sftp" that is only allowed sftp access that also owns the folders where the nodejs apps are.
To set up auto-start on boot and file watch I did:
pm2 startup systemd
*pasted the cmd output*
pm2 start path/to/project/index.js --watch --name app_name
pm2 save
It autostarts on boot, but when I make a change to the project files (I confirmed they get synced to the remote), pm2 doesn't reload the app.
I read in some places that the user watching for changes has to be the same as the owner of said files, how do I do this? I tried sudo su before starting the app via pm2, but that also didn't work.
Thank you in advance.