jessety / pm2-installer

Install PM2 offline as a service on Windows or Linux. Mostly designed for Windows.
MIT License
492 stars 49 forks source link

pm2-logrotate bug with offline install #17

Open matbandeli opened 3 years ago

matbandeli commented 3 years ago

Description I have installed pm2 and pm2-logrotate with pm2-installer

The issue is that the module pm2-logrotate is not restarted on laptop reboot

The problem happens when I install offline only. With an online install, pm2-logrotate is running fine after a reboot.

Steps to Reproduce

  1. Installing NodeJS with node-v12.20.1-x86.msi
  2. Download your project
  3. Open command prompt as admin and cd to your project
  4. Create the bundle on the same device with command npm run bundle
  5. Install offline with the following commands
    • npm run configure
    • npm run configure-policy
    • npm run setup
  6. pm2 list is showing pm2-logrotate module
  7. Reboot device
  8. pm2 list => module pm2-logrotate seems to have disapeared !

Environment Running on: 2021-2-4, pm2-installer 3.1.1 with node v12.20.1 and npm 6.14.10 on win32-10.0.19041.

I can add some logs if you think it might be usefull. (logs about install run for example).

edit : I removed some steps so that the case is simpler to reproduce, but the problem is still persisting

matbandeli commented 3 years ago

I found this discussion https://github.com/Unitech/pm2/issues/3997 which mention a similar problem

jessety commented 3 years ago

Hi @matbandeli!

This has been on my radar for a while, but it seemed inconsistent the last time I looked into it. I was able to reproduce right away with your steps on an offline machine. I believe I might have to use a different technique than the one I'm using to mitigate this. I'll have to do some research.

Thanks for reporting this!

matbandeli commented 3 years ago

Hi @jessety,

Thx for answering fast. It seems that the changes in this new branch are solving this issue.

p.s. I didnt test the npm run remove command to uninstall

matbandeli commented 3 years ago

Note that at the moment, in this branch, the npm run bundle command will only work properly if pm2 is not already installed.

This solution is a draft and there is obviously room for improvement. I am open to any proposal