coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.8k stars 356 forks source link

Service not auto started after rebooting system #193

Closed ashwinijindal10 closed 4 years ago

ashwinijindal10 commented 6 years ago

i am facing the issue after installing service , which run my node program using node-windows package, it creates a service successfully with automatic start up mode but when i restart my system to verify service auto start mode, it does not get started automatically , when i look at the event viewer logs , it shows service manager has tried to re start the service after system reboot , but it failed to do that due to "The service did not respond to the start or control request in a timely fashion." and another one "A timeout was reached (30000 milliseconds) while waiting for the Hello.exe service to connect." but when i try to start that service manually, it works very well. It is hard to figure out why service get failed when system try to start it after reboot.

ashwinijindal10 commented 6 years ago

i solved this problem , by updating the file "winsw.js","daemon.js" inside of node-window package .As attached images to configure my service dependent on Eventlog,W32Time services .

--daemon.js

image

--winsw.js file

image

create dependancy on other service (system service in my case you can add any one ) image

please refer https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md for more details

nicoabie commented 6 years ago

@ashwinijindal10 Care to provide a pull-request with the changes so it is easier to see the diffs?

coreybutler commented 4 years ago

Closing due to age. I'd love to see a PR of this too.

Kriess2507 commented 1 year ago

i am facing the issue after installing service , which run my node program using node-windows package, it creates a service successfully with automatic start up mode but when i restart my system to verify service auto start mode, it does not get started automatically , when i look at the event viewer logs , it shows service manager has tried to re start the service after system reboot , but it failed to do that due to "The service did not respond to the start or control request in a timely fashion." and another one "A timeout was reached (30000 milliseconds) while waiting for the Hello.exe service to connect." but when i try to start that service manually, it works very well. It is hard to figure out why service get failed when system try to start it after reboot.

@ashwinijindal10 what configurations did you do to start your services automatically?