[python-win32] Service does not start at windows boot but at user's login

spoirot stephane.poirot at linbox.com
Thu Jun 5 10:21:10 CEST 2008


bob gailer wrote :
>
> I run Windows 2003 Server with automatic logon. It seems to me that 
> some services are started after the logon. I base this on noting that 
> I get the Some Services Did Not Start alert many seconds after my 
> desktop has appeared.
>
> Could the client repeatedly try connecting with some reasonable delay 
> between connection attempts?
>
Mark Hammond wrote :
> XP and Vista both pull a few tricks to get you logged on before all 
> services have started - there are no guarantees that all services will 
> be started before any user programs. It's probably best to just have 
> your client deal with the situation (either by blindly, but smartly, 
> retrying, or by querying the service status and waiting until it is 
> reporting it is started.) 

Thank you for feedback.

I have already solved the problem of the connection of the client after 
the service : the client waits until the server has started.
It works by putting a delay between each connection attempt, but I 
prefered play with exception returned when the pipe isn't
opened yet : I wait until this exception occur : when the pipe has just 
opened, my client works. If I put a delay,
I have chances not to see the opening of the pipe when it just occurs.

But the big problem is that my service has to alter some registry keys 
in HKLM hive, and these changes have to be done after any user login : 
indeed,
 I would like to set these keys at windows boot in order that when 
anyone logs in, the changes take effect. If the changes are done at 
user's login,
(which is the case because the service starts after the client) then 
they will only be effective when the user reboots, so the user has to 
reboot and
it's not what I want : I want to put changes at windows boot so that 
when a user logs in, changes are validated and he doesn't have to reboot.

I use a Vmware Server Console with Windows XP Service pack 2 on it. I 
noticed some time synchronization problems as my clock was very quick :
one minute in the reality almost equals to 3 on the machine. It could 
have an influence on the boot of my programs. I solved this problem with 
Vmware tools,
so I could synchronize clock with my host operating system, but it 
changes nothing to the main problem...


More information about the python-win32 mailing list