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

Run As Service? #137

Open
Volxz opened this issue Jun 15, 2017 · 11 comments
Open

Run As Service? #137

Volxz opened this issue Jun 15, 2017 · 11 comments

Comments

@Volxz
Copy link

@Volxz Volxz commented Jun 15, 2017

Is there any way for me to make the app run as a service? I don't like the command prompt window open while the app is running. Thanks!

@sergiodxa

This comment has been minimized.

Copy link

@sergiodxa sergiodxa commented Jun 15, 2017

You can use pm2 or another way to lunch your app as a service, that's external to pkg.

@Volxz

This comment has been minimized.

Copy link
Author

@Volxz Volxz commented Jun 15, 2017

@sergiodxa This is ideal for what I want to accomplish. I am trying to make a client-side app that runs as a service. All i need to do is daemonize the process.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 16, 2017

why not use for example : winsw if in windows?

@thbl

This comment has been minimized.

Copy link

@thbl thbl commented Jun 27, 2017

+1

@peterbabic

This comment has been minimized.

Copy link

@peterbabic peterbabic commented Jul 7, 2017

I was able to do this with nssm without any problems

@slmmm

This comment has been minimized.

Copy link

@slmmm slmmm commented Jul 7, 2017

I am using nssm as well, but am getting an issue when attempting to Stop the service. It times out and I have to kill the task from Windows Task Manager. @peterbabic - have you had similar issue?

@anvilation

This comment has been minimized.

Copy link

@anvilation anvilation commented Jul 10, 2017

I have been using WinSW to wrap my .exe with no issues. Using Wix I have been had been able to script the install of the service

<CustomAction Id="StartMonitorServer" Directory="SERVER" ExeCommand="[SystemFolder]cmd.exe /c my-server.exe install" Execute="immediate" Return="ignore" Impersonate="yes" />

Most of the issues with stopping and starting my services have been down to either port in use errors (which WinSW logs out very nicely) and lack of Administrator privileges (which is the same old Windows malarky)

@tauqeer81

This comment has been minimized.

Copy link

@tauqeer81 tauqeer81 commented Aug 3, 2017

@sergiodxa how to run pkg binary file with pm2 in ubuntu?

@crapthings

This comment has been minimized.

Copy link

@crapthings crapthings commented Dec 5, 2017

@sergiodxa yeah how ?

@crapthings

This comment has been minimized.

@ataft

This comment has been minimized.

Copy link

@ataft ataft commented Mar 13, 2018

As @crapthings points out, pm2 can handle binary code execution, and I've checked that the following does work (Windows):
pm2 start myzeitpkgapp.exe

However, cluster mode doesn't appear to work this way. For example, the following should start four processes/instances, but only starts one:
pm2 start myzeitpkgapp.exe -i 4

If that one process goes down, pm2 successfully brings it back up, but it never kicks off 4 processes. I'm probably misunderstanding something, but is it possible to package the pm2 logic within the Zeit PKG executable? Then, executing myzeitpkgapp.exe would essentially call "pm2 start ./main.js -i 4"...

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

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.