From: aurora <aur...@gm...> - 2004-12-21 18:19:56
|
I use the sample and build a NT service subclass from = win32serviceutil.ServiceFramework. It provides a decent set of command = line options like this ------------------------------------------------------------------------= ------ Usage: 'myservice.py [options] install|update|remove|start = [...]|stop|restart [...]|debug [...]' Options for 'install' and 'update' commands only: --username domain\username : The Username the service is to run under --password password : The password for the username --startup [manual|auto|disabled] : How the service starts, default =3D= = manual --interactive : Allow the service to interact with the desktop. ------------------------------------------------------------------------= ------ I have enhanced it to include some custom command line option so that it= = can double as an interactive application and a NT service. This works wh= en = I launch it as a python script. Once I build it with py2exe, it seems to= = put a different wrapper around it. Launching it from command line would = = get: ------------------------------------------------------------------------= ------ Services are supposed to be run by the system after they have been = installed. These command line options are available for (de)installation: -help -install -remove -auto -disabled -interactive -user: <arg> -password: <arg> Connecting to the Service Control Manager Traceback (most recent call last): File "boot_service.py", line 166, in ? pywintypes.error: (1063, 'StartServiceCtrlDispatcher', 'The service = process could not connect to the service controller.') ------------------------------------------------------------------------= ------ Why is there seems to be two different wrapper for NT service? Is it = possible for to add custom command line option like what I did to the = original launcher? Thanks. |