[Zope-CVS] CVS: Packages/WinBuilders/zeo_addons/skel/bin -
runzeo.bat.in:1.1 zeoservice.py.in:1.1
Chris McDonough
chrism at zope.com
Wed Aug 20 17:53:53 EDT 2003
Update of /cvs-repository/Packages/WinBuilders/zeo_addons/skel/bin
In directory cvs.zope.org:/tmp/cvs-serv25898/zeo_addons/skel/bin
Added Files:
runzeo.bat.in zeoservice.py.in
Log Message:
Make ZEO buildout nominally work.
=== Added File Packages/WinBuilders/zeo_addons/skel/bin/runzeo.bat.in ===
@set PYTHON=<<PYTHON>>
@set ZEO_HOME=<<ZEO_HOME>>
@set SOFTWARE_HOME=%ZEO_HOME%\lib\python
@set INSTANCE_HOME=<<INSTANCE_HOME>>
@set CONFIG_FILE=%INSTANCE_HOME%\etc\zeo.conf
@set PYTHONPATH=<<SOFTWARE_HOME>>
@set ZEO_RUN=%SOFTWARE_HOME%\ZEO\runzeo.py
"%PYTHON%" "%ZEO_RUN%" -C "%CONFIG_FILE%" %1 %2 %3 %4 %5
=== Added File Packages/WinBuilders/zeo_addons/skel/bin/zeoservice.py.in ===
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
A Windows NT service frontend.
Usage:
Installation
The service should be installed by the Windows installer. You can
manually install, uninstall the service from the commandline.
ntservice.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 = manual
Commands
install : Installs the service
update : Updates the service, use this when you change
the service class implementation
remove : Removes the service
start : Starts the service, this can also be done from the
services control panel
stop : Stops the service, this can also be done from the
services control panel
restart : Restarts the service
debug : Runs the service in debug mode
You can view the usage options by running ntservice.py without any
arguments.
Note: you may have to register the Python service program first,
win32\PythonService.exe /register
Starting
Start the service by clicking the 'start' button in the services
control panel. You can set the service to automatically start at boot
time by choosing 'Auto' startup by clicking the 'statup' button.
Stopping
Stop the service by clicking the 'stop' button in the services
control panel.
Event logging
Events are logged to the NT application event log. Use the event
viewer to keep track of events.
Note: to successfully run this script, the software home needs to be
on the PYTHONPATH.
"""
import os.path
from os.path import dirname as dn
import sys
# these are replacements from mkzeoinstance
PYTHON = r'<<PYTHON>>'
SOFTWARE_HOME=r'<<SOFTWARE_HOME>>'
INSTANCE_HOME = r'<<INSTANCE_HOME>>'
ZEO_HOME = r'<<ZEO_HOME>>'
ZEO_RUN = r'%s\ZEO\runzeo.py' % SOFTWARE_HOME
CONFIG_FILE= os.path.join(INSTANCE_HOME, 'etc', 'zeo.conf')
PYTHONSERVICE_EXE=r'%s\bin\PythonService.exe' % ZEO_HOME
sys.path.insert(0, SOFTWARE_HOME)
from nt_svcutils import service
servicename = 'ZEO_%s' % str(hash(INSTANCE_HOME))
class InstanceService(service.Service):
start_cmd = '"%s" "%s" -C "%s"' % (PYTHON, ZEO_RUN, CONFIG_FILE)
_svc_name_ = servicename
_svc_display_name_ = 'ZEO instance at %s' % INSTANCE_HOME
_exe_name_ = PYTHONSERVICE_EXE
if __name__ == '__main__':
import win32serviceutil
win32serviceutil.HandleCommandLine(InstanceService)
More information about the Zope-CVS
mailing list