Good morning,

I'm currently building an application which involves two different processes : one is a service and the other one is a simple client. My client starts at user's login and the service should start at windows boot. I say 'should' because it seems that the service actually starts at user's login too : I put logs in the event log and I noticed that the service starts almost 7 to 10 seconds after the client, which is not what is expected. Service's properties are : run automatically on System account, no dependencies. The code of my service is based on the one found in the book : Oreilly, Python Programming on Win32, at chapter 18.6 :
Sample Service Written in Python.


Furthermore, my two processes communicate through a named pipe, and the problem aforementioned involves that the communication is not possible : indeed, the service, who should start before the client, creates the pipe and waits for a client connection. Client has just to open the pipe to connect. But obviously if the client starts before the service, an error occurs because no pipe is created so far.

I did a lot of searches to solve this problem, but haven't found any issue yet. I first thought that the problem came from pythonservice.exe, which hosts my service : it may take longer time to load than common other windows services. That's why I converted my service into a .exe thanks to py2exe. Then the path in service's properties has changed to this executable. But the problem remains : service still starts after client. However, the problem only occurs at first user's login after machine's boot : if he disconnects and somebody connects after, without reboot, the service is
still running, which is normal.

That's why I would ask if anyone  has an idea for solving this problem.
Thank you in advance for your answers.

Stéphane POIROT
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to