0

I need to create a service from a python script, for this I am using NSSM(Non-sucking service manager). I am able to install the service using below command: nssm install However when I try to start the service, it gets in Paused state.

nssm start <Service_Name>

When I try to resume/stop/restart from the services.msc it gives error like Windows could not start the service.

The python script I am using is below:

import sys
for i in range(sys.maxsize**10):
with open("D:\PythonWriteFile.txt","a") as myfile:
    myfile.write("Appended text")

Please let me know how can I make python script as service.

Pawan Dubey
  • 192
  • 3
  • 15

1 Answers1

0

I am not very experienced with nssm, but on their website, they wrote:

2017-04-26: Users of Windows 10 Creators Update should use prelease build 2.2.4-101 to avoid an issue with services failing to start. If for some reason you cannot use that build you can also set AppNoConsole=1 in the registry, noting that applications which expect a console window may behave unexpectedly.

I'd try the version thing, perhaps this is it

Nyta
  • 557
  • 1
  • 7
  • 18