On Mar 13, 12:37 am, AJ ONeal <[email protected]> wrote:
> It appears that `process.exit()` doesn't not work on windows when a node
> app is running as a service.
>
> Is this a bug? Or simply not possible?
> Does anybody have a workaround?
>
> I'm thinking maybe I can exec `net nodeapp restart` after calling
> `process.exit()`
>
> I'm working on a self-updating feature and I want my service to quit itself
> and be automatically restarted.
>
> AJ ONeal
I assume that you are using some sort of service wrapper (like
srvany.exe), since node.exe itself cannot run as a service at the
moment. It could be that your service wrapper is just restarting your
node process when it exits. It seems unlikely to me that
process.exit() would just be ignored.
You probably should send a service stop signal, with something similar
to:
`require('child_process').spawn('sc', ['stop', 'myservicename']);`
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en