|
From: Leif M. <le...@ta...> - 2009-04-17 23:25:03
|
Christian, It is possible to run multiple instances of the Java Service Wrapper as services on the same machine, but each wrapper's configuration must have a unique service name and description. In addition, if the two services are running from the same directory, you will need to make sure that they each write to their own wrapper.log file. There are a couple ways of doing this that might work for you. 1) I have done things like this before by creating a shared wrapper-common.conf file which contains all of the common configurations. Then create a separate wrapper-app-N.conf file for each of your services, including the common configuration file: wrapper-app-N.conf: --- #include ../conf/wrapper-common.conf wrapper.logfile=../logs/wrapper-app-N.log wrapper.ntservice.name=app-N wrapper.ntservice.displayname=Application N --- 2) Another solution is to take advantage of the ability to set environment variables by setting properties, and the fact that any property can be set on the command line. Modify the following properties as follows: wrapper.logfile=../logs/wrapper-%APPN%.log wrapper.ntservice.name=app-%APPN% wrapper.ntservice.displayname=Application %APPN% Then when you launch the Wrapper, do so as follows: wrapper.exe -c ..¥conf¥wrapper.conf set.APPN=1 The service can be installed as follows: wrapper.exe -i ..¥conf¥wrapper.conf set.APPN=1 The above will be stored when the service is registered with the ServiceManager so it will work correctly when starting and stopping the service. You will need to specify the APPN value whenever you run the wrapper with any of its commands. Let me know how this works for you. Cheers, Leif On Fri, Apr 17, 2009 at 10:24 PM, Christian Hehtke <ch...@aa...> wrote: > Hi all, > > > > I would like to know what the best pratice for the following scenario is. > > > > I have an application which has to install system services at runtime, > depending on how much of the services are defined in configuration .These > system services will often call the same class in the same jar, but with > different parameters. > > Is there a way to accomplish that without copying the config files, etc? > > Thanks in advance > > > > Christian |