By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,172 Members | 727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,172 IT Pros & Developers. It's quick & easy.

py2exe failed for running compiled service

P: n/a
hi, i'm trying to generate a service for win XP / win 2k with
python2.3.3 + win32all-163 + py2exe0.5.0
(also tried with pywin32-200.win32-py2.3)

running the console-script "FBxmlserv.py" with python-interpreter and as
EXE-prog goes well.
running the service-module "FBservice.py" with python-interpreter also
works fine
but after comiling with py2exe (with no warnings or errors!) i get on
every host the same error message
when trying to execute the FBservice.exe
FBservice.exe Connecting to the Service Control Manager
Traceback (most recent call last):
File "boot_service.py" line 158, in ?
pywintypes.error: (1063, 'StartServiceCtrlDispatcher', 'Der
Dienstprozess konnte keine Verbindung zum Dienstcontroller herstellen.')

has anyone an idee, what to do?

thanks

my "setup.py" script:
from distutils.core import setup
import py2exe
import sys

if len(sys.argv) < 2:
sys.argv.append ( "py2exe" )
sys.argv.append ( "--verbose" )
sys.argv.append ( "--packages" )
sys.argv.append ( "encodings" )
#sys.argv.append ( "-q" ) # be quiet

class Target:
def __init__ (self, **kw):
self.__dict__.update ( kw )

# for versioninfo resources
self.version = "0.9.0"

FBserver = Target (
description = "firebird backend server",
script = "FBxmlserv.py",
)

FBservice = Target (
description = "firebird windows nt service",
modules = ["FBservice"],
)

excludes = [ "pywin.debugger.dbgcon", "pywin.dialogs", "pywin.dialogs.list" ]
setup (
options = { "py2exe" : {
"compressed" : 1,
"optimize" : 2,
"excludes" : excludes
}
},
zipfile = "lib/shared.zip",
service = [FBservice],
console = [FBserver],
)



Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Peter Teniz <pe*********@inverisa.net> writes:
hi, i'm trying to generate a service for win XP / win 2k with
python2.3.3 + win32all-163 + py2exe0.5.0
(also tried with pywin32-200.win32-py2.3)

running the console-script "FBxmlserv.py" with python-interpreter and as
EXE-prog goes well.
running the service-module "FBservice.py" with python-interpreter also
works fine
but after comiling with py2exe (with no warnings or errors!) i get on
every host the same error message
when trying to execute the FBservice.exe
> FBservice.exe

Connecting to the Service Control Manager
Traceback (most recent call last):
File "boot_service.py" line 158, in ?
pywintypes.error: (1063, 'StartServiceCtrlDispatcher', 'Der
Dienstprozess konnte keine Verbindung zum Dienstcontroller herstellen.')

has anyone an idee, what to do?


This is not a bug.

Services are supposed to be started by the system - the windows service
control manager. They have to be registered before, and the exe accepts
some command line switches that help with this.

You can run the service exe with the '-help' command line switch to list
them:

C:\Python23\Lib\site-packages\py2exe\samples\advanced\dist>MyService.ex e -help
Usage: MyService.exe <options>. Valid options are:
-help
-install
-remove
-auto
-disabled
-interactive
-user: <arg>
-password: <arg>

C:\Python23\Lib\site-packages\py2exe\samples\advanced\dist>

So, first you install your service exe with this command line:

'MyService.exe -install'

The other switches -auto, -disabled, -interactive, -user and -password
allow to specify additional service options.

After that, the service can be started with 'net start myservice' or
with the services applet in the control panel.

Thomas

PS: If this seems not appropriate, it can be changed by hacking the
py2exe/boot_service.py script.
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.