[python-win32] Runnin Python app as service with separateconsole

Mark Hammond mhammond at skippinet.com.au
Tue Apr 11 02:29:17 CEST 2006


> "install_3d_app_service.cpp" is a program to install
> sftc3win.exe(sftc_3d_app_service.cpp)
> into a Windows' service. Inside sftc_3d_app_service.cpp, it will spawn
> "python".
> After reboot the machine, no problem, everything works fine, please see
> attached
> picture python_running.JPG. The problem is that after I log off, the
> "python" has gone.

I'm afraid you don't mention what this spawned Python is supposed to do.
Regardless though, it appears that exe is terminating, probably due to an
exception.  You need to arrange to see the output of this process to see
what went wrong.

If it is your .cpp implemented service that vanishes, then I've no idea what
it could be.

> Even if I log in as a non-administrative account, I log off, then the
> "python" has gone,
> even I am in the session of non-administrative account, I can not
> terminate(End Process)
> the "python" process. I am totally confused by this.

It is normal (but frustrating) you can't kill it as the service is running
as LocalSystem.  You may have more luck setting it to run as your user.

I'm a little confused though, as you seem to say the problem is that the
python process has gone - but here you are failing to kill it.

> I also can use Windows' Scheduled Tasks to add a task as "At System
> startup", I can run
> it as a service, but after I log in/log off any account, the "python"
> service has gone.

The service (implemented in .cpp) has gone, or the child python executable?
Same answer as above though...

Mark



More information about the Python-win32 mailing list