Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using a service instead of startup registry entry #2

Open
marklagendijk opened this issue Oct 7, 2015 · 1 comment
Open

Start using a service instead of startup registry entry #2

marklagendijk opened this issue Oct 7, 2015 · 1 comment

Comments

@marklagendijk
Copy link
Owner

Currently pm2 resurrect is called via a command which runs based on registry startup entry. The problem with this approach is that it only runs after a user has logged in. This a a problem for servers.

Probably the solution to this is to trigger the pm2 resurrect command via a Windows service. This could be implemented using node-windows.

@marklagendijk
Copy link
Owner Author

Winser also looks very interesting. pm2 also can be used programmatically, so the following should work:

index.js:

var pm2 = require('pm2');
pm2.resurrect();

package.json

{
  "scripts": {
    "postinstall": "winser -i -s -c",
    "preuninstall": "winser -r -x -s",
  }
}

With this installing should just be a matter of npm install pm2-windows-startup -g and uninstalling of npm uninstall pm2-windows-startup -g.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant