Reputation: 16060
I have the following Code:
tomcat5.exe //IS//%SERVICE_NAME% --StartPath "%BASE_DIR%\bin" --Jvm "%JAVA_HOME%\bin\%JAVA_MODE%\jvm.dll" --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap --StartParams "-config;%CONFIG%;start" --StopParams stop --Startup auto
tomcat5.exe //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%#-Dcatalina.home=%CATALINA_HOME%#-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed#-Xrs#-Djava.library.path=%DLL_DIR%#-DimageservicePath=%imageservicePath%" --StartMode jvm --StopMode jvm
tomcat5.exe //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp"
tomcat5.exe //US//%SERVICE_NAME% --JvmMx %MEMORY% --JvmMs %MIN_MEMORY%
tomcat5.exe //US//%SERVICE_NAME% --Environment "PATH=.\;c:\path\bin"
I need to specify a special PATH, because some native-code loading issues.
My problem is, that the service-installer will change provided PATH: http://tomcat.apache.org/tomcat-5.5-doc/windows-service-howto.html
--Environment
List of environment variables that will be provided to the service in the form key=value. They are separated using either # or ; characters
I need to specify a Windowes PATH with two locations: PATH=.;c:\path\bin
The path will be stored within the registry:
PATH=.
c:\path\bin
it should be:
PATH=.;c:\path\bin
It works as described, so I think I missed something, but I did not find anything about how to set the PATH and solve this issue...
PS: I know I'm using an outdated version of tomcat.
Upvotes: 3
Views: 1890
Reputation: 16060
Well, after I downloaded the source and figured out, that the apache-commons procrun deamon is used and I finally found the solution. The documentation at the tomcat project wasn't complete:
http://commons.apache.org/daemon/procrun.html
++Environment
List of environment variables that will be provided to the service in the form key=value. They are separated using either # or ; characters. If you need to embed either # or ; character within a value put them inside single quotes.
The last sentence lead to the solution:
"%EXECUTABLE%" //US//%SERVICE_NAME% --Environment "PATH='%PATH%'"
Upvotes: 3