Mindera / pm2-cookbook

Chef cookbook to install and manage PM2.
MIT License
23 stars 17 forks source link

:startup generates dump file as root instead of using user if provided in version 0.7.1+ #26

Open bcurnow opened 7 years ago

bcurnow commented 7 years ago

The following was added to providers/application.rb in commit 354060ce8fcf856e93dfa6d4a264b5b66a0bd081

The following was added:

Save running processes

cmd = 'pm2 save' execute cmd do environment pm2_environment command cmd end

This block either needs to specify the user (if provided) or use the built-in pm2_command like this:

Save running processes

pm2_command('save')

Otherwise the file is executed as the current user (typically root) and causes permission errors when trying to run as the correct user.