pm2-installer icon indicating copy to clipboard operation
pm2-installer copied to clipboard

node processes get killed after session sign out

Open itm-platform opened this issue 1 year ago • 4 comments

Whenever I sign out, my pm2 / node processes get killed. When signing in back again, the only one visible is the module @jessety/pm2-logrotate

Installation

I installed pm2-installer following the steps as Admin: npm run configure, npm run configure-policy, npm run setup.

What I've tried

  • The PM2 service was consistently stopped after logging out / in. I changed the service Log On to Local Service with the same effect. Then I changed to my user (Windows admin), which seems to keep the service running.
  • I granted permissions to the folder C:\ProgramData\pm2 to all users
  • Rebooted several times and re-run npm configure and setup several times

info: Running on: 21/03/2023, pm2-installer 3.4.3 with node v14.15.3 and npm 6.14.9 on win32-10.0.17763.

Thanks for any help!

itm-platform avatar Mar 21 '23 16:03 itm-platform

I'm having the same issue. The @jessety/pm2-logrotate module is running, but the app.js is not. I can use the command pm2 resurrect and it starts the app. I have also tried going to services and making sure that pm2 is running on the Local System account.

gktval avatar Apr 12 '23 16:04 gktval

I'm using nvm to upgrade the Node.js version from v14 to v18.16.0 and then the mentioned issue occurred. After some trial and error, I solved the issue with the following steps:

  1. Uninstall it.
npm run remove
  1. Run Tasks Manager and kill all the node.exe processes.

  2. Install again.

npm run configure
npm run setup
  1. Register all apps.

lauhw avatar Apr 25 '23 11:04 lauhw

What ended up working for me was to tick "Allow service to interact with desktop" in the Logon tab on the service properties. image

itm-platform avatar Apr 25 '23 11:04 itm-platform

Thanks a lot @itm-platform. The pm2 service was shutting down almost as soon as it started. Just rebooted the server (for the sake of testing) and my three node apps are running as expected.

Server environment:

  • Windows Server 2022
  • Node 18.16.0 - 64-bit

Last thing, I upgraded the dependencies in package.json before running:

npm run configure
npm run configure-policy
npm run setup
"dependencies": {
  "@jessety/pm2-logrotate": "^2.7.4",
  "node-windows": "1.0.0-beta.8",
  "pm2": "5.3.0"
},

mstgelais avatar Apr 29 '23 21:04 mstgelais