문제

If I am starting a service (net start abc) from python, how can I make it such the service starts as a child process under python but not as a system process.

More Info:

  1. I am starting a webserver by using net start from python.

  2. I am also opening a browser from python with a command requesting a stream from the web server.

  3. Python executes the net start command but the service starts as a system process.

  4. Is there a switch I can use to start the service under python as a child process, because I have a debugger attached to python and I want to debug the service.

도움이 되었습니까?

해결책

Launching an established service as a child process of Python won't be possible. A Windows Service is started and controlled by the Windows Service Control Manager and the associated process will be a child of the "services.exe" process.

Perhaps, if your service's underlying executable permits it, you may be able to invoke the executable directly from Python instead of using "net start". But of course then, it won't be running as a service...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top