Do you know what signal the main NodeJS process receives when a Windows 
service is stopped? 

I am using NSSM to install my NodeJS process as a Windows service. But when 
I stop the Windows service,* the child processes keep running*. 

Do you know how to solve this? 

Op dinsdag 13 maart 2012 05:21:47 UTC+1 schreef CoolAJ86 het volgende:
>
> nssm.exe, actually.
>
> And yes, I do want the service to be restarted.
> On app startup there's a loop that requires all modules in a directory.
>
> Each time a new module in installed, the service should exit.
> It should then be restarted, rereading all of the modules (including the 
> new one).
>
> When running the app in the foreground it works as expected.
> When running the app as a service it doesn't exit.
>
> I'll figure it out tomorrow.
>
> AJ ONeal
>
>
> On Mon, Mar 12, 2012 at 7:46 PM, Bert Belder <[email protected]<javascript:>
> > wrote:
>
>> 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]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to