I am running a Python script as a Windows service, but it seems to be failing whenever I set it to auto-start. I believe this may be because the service uses network resources that are not yet mounted when the service starts. Is there a way I can get it to wait until startup is complete before running?
+2
A:
Add in script wait for the resources who script must use is in good standing, or rewrite script to better design like not exit if dont have connection; wait 1s and try again if connection failed.
Svisstack
2010-09-02 11:54:39
You're right, of course. I think I was just being lazy and not wanting to debug what's actually going wrong. But of course, I will!
psicopoo
2010-09-02 12:33:48
+7
A:
Configure your Windows Service so that it has the Workstation
Service as a dependency.
This means Windows won't attempt to start your service until the appropriate resources are available.
Dave Webb
2010-09-02 13:01:20
I should really read more about Windows internals, I'm always surprised when I find out that things like this exist :-\
Dana the Sane
2010-09-02 15:39:36