1

My application periodically checks a log file for changes. If changes are found, it updates a webpage (via websockets). If no changes are found, nothing happens.

When I run the application in the console, it works exactly as desired. I've used cx_Freeze to generate an executable (and associated .DLL/supporting files), which also works as planned when the executable is run manually.

I've used NSSM to add this executable as a Windows Service (Server 2003), and added administrator login capabilities so the service can run without any active users logged in. The application doesn't appear to function 100% as a Windows Service; when changes are made to the log file, the service will only intermittently update the webpage.

Is this the best way of turning a Python application into a Windows Service, or should I avoid NSSM (I think NSSM is awesome!) and use cx_Freeze's native service functionality?

jars121
  • 1,127
  • 2
  • 20
  • 35
  • Does the python script have to be an exe? This all gets a lot easier if you can just use window's task scheduler on batch files. – abaldwin99 Aug 03 '15 at 01:03
  • It doesn't have to be an executable. I've tried to implement the desired functionality using both executables and batch files with Task Scheduler, but found that the time resolution offered by the scheduler wasn't ideal (only run once a minute, etc.), as my current solution (using apscheduler within the application) allows for more control and more frequent recursion. – jars121 Aug 03 '15 at 01:09

0 Answers0