![]() You can capture the "SIGINT" in your NodeJS script and make a clean exit. Windows will send a "SIGINT" to your script to make it stop, then give it a few seconds before it's killed completely. ![]() This can be done both from NSSM and the dependency tab in Windows service manager (services.msc). Then Windows will make sure mySQL always starts before your script runs. Lets say your node script access a mySQL server, then add mySQL as a dependency. Make sure you add anything your script depends on as a service dependency. And run even if you are not logged in! Start after another service has started Your Node.JS script will then run as a service and startup after reboot. To start the service, find it in Windows service manager (hit Win+R, type: services.msc and click OK/Enter), or type "net start nameOfYourService" in the command prompt.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |