|
From: Michael M. <mr...@vm...> - 2012-10-24 22:21:04
|
Thanks Leif, quite helpful. So here's what I have now. c:\type myapp-startup.bat .... rem The base name for the Wrapper binary. set _WRAPPER_BASE=vws-wrapper rem The name and location of the Wrapper configuration file. This will be used rem if the user does not specify a configuration file as the first argument to rem this script. set _WRAPPER_CONF_DEFAULT=../conf/vws-wrapper.conf rem Note that it is only possible to pass parameters through to the JVM when rem installing the service, or when running in a console. # setup VM's memory settings, variables picked up by ../conf/vww-wrapper.conf # see https://wiki.eng.vmware.com/CloudVM/Sizing # APP_NAME must match entry in vws-wrapper.conf set APP_NAME=vmware-vws if not defined VMWARE_JAVA_HOME exit 2 if not defined VMWARE_CLOUDVM_RAM_SIZE exit 3 if not defined VMWARE_LOG_DIR exit 4 set JAVA_HOME=%VMWARE_JAVA_HOME% set /a MAXMEM_VALUE=0 set /a MINMEM_VALUE=0 set /a VAR=0 set size_cmd='"%VMWARE_CLOUDVM_RAM_SIZE%" %APP_NAME%' for /f %%A in (%size_cmd%) do ( set /a VAR=%%A ) set /a MAXMEM_VALUE += %VAR% if %MAXMEM_VALUE == 0 exit 5 if %MINMEM_VALUE% == 0 set MINMEM_VALUE=16 echo "'%APP_NAME%' is using a starting heap of %MINMEM_VALUE% and a max of %MAXMEM_VALUE% mb rem Do not modify anything beyond this point rem --------------------------------------------------- .... BTW, this warning was helpful was well since the design we were toying with internally was not placing wrapper.java.command=c:\some-wrapper-that-calls-java\script.bat And was seeing this: DEBUG | wrapper | 2012/10/24 14:35:51 | Waiting 5 seconds before launching another JVM. DEBUG | wrapper | 2012/10/24 14:35:56 | Magic number for file vmware-vws.bat: 0x4072656d WARN | wrapper | 2012/10/24 14:35:56 | The value of wrapper.java.command does not appear to be a java binary. WARN | wrapper | 2012/10/24 14:35:56 | The use of scripts is not supported. Trying to continue, but some features may not work correctly.. Mike MacFaden Staff Engineer, VMware , Palo Alto CA ----- Original Message ----- > Michael, > There are a number of ways to pass values into the Wrapper to do what > you want. The method you use will depend on the circumstances under > which you will be changing the memory size settings. > 1) Environment variables. > http://wrapper.tanukisoftware.com/doc/english/props-envvars.html > It is possible to reference any environment variable from within your > wrapper.conf file. These values of course will only work when the > environment is loaded. This means that if you change the environment > (SYSTEM in most cases) you will need to restart the Wrapper service > itself for the changes to take affect. If you use environment > variables, you do so as follows: > Environment: |