https://bz.apache.org/bugzilla/show_bug.cgi?id=66018
Bug ID: 66018
Summary: tomcat8.exe and tomcat9.exe when creating a service
via command line requires --LogPath
Product: Tomcat 9
Version: unspecified
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Created attachment 38252
--> https://bz.apache.org/bugzilla/attachment.cgi?id=38252&action=edit
side-by-side comparison between services created with and without --LogPath
Prior to vresions 8.5.78 & 9.0.62 we ran an installation script to create
catalinabase services without passing --LogPath parameter. In the above
mentioned versions if omitted --LogPath from the command string, the service
does not pick up any Java settings.
#region Create Tomcat Service
# Copying tomcat8/w.exe to reflect service name"
$tcexe="$ServiceName.exe"
$tcwexe="$ServiceName"+"W.exe"
Copy-Item $tchome\bin\tomcat8.exe -Destination $tchome\bin\$tcexe -Force
Copy-Item $tchome\bin\tomcat8w.exe -Destination $tchome\bin\$tcwexe -Force
#Store command for creating a Tomcat service
Previous code:
$servicecommandstring = "$tchome\bin\$tcexe //IS//$ServiceName --Install
`"$tchome\bin\$tcexe`" --Description `"catalinabase$CatbaseNumber`" --Startup
auto --JavaHome `"$javahome`" --Jvm `"$javaruntimelib`" --JvmMs 512 --JvmMx
1024 --JvmOptions
`"-Xrs;-Dcatalina.home=$tchome;-Dcatalina.base=$catbase;-Djava.io.tmpdir=$catbase\temp;-Djava.security.manager;-Djava.security.policy=$catbase\conf\catalina.policy;-Duser.timezone=UTC;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=$catbase\conf\logging.properties`"
--StartMode jvm --StopMode jvm --StartClass
`"org.apache.catalina.startup.Bootstrap`" --StopClass
`"org.apache.catalina.startup.Bootstrap`" --StartParams start --StopParams stop
--Classpath `"$tchome\bin\bootstrap.jar;$tchome\bin\tomcat-juli.jar`""
New Code: LogPath had to specified
$servicecommandstring = -Join ("$tchome\bin\$tcexe //IS//$ServiceName",
" --Install `"$tchome\bin\$tcexe`"",
" --Description `"catalinabase$CatbaseNumber`"",
" --Startup auto",
" --LogPath `"$catbase\logs`"",
" --JavaHome `"$javahome`"",
" --Jvm `"$javaruntimelib`"",
" --JvmMs 512",
" --JvmMx 1024",
" --JvmOptions
`"-Xrs;-Dcatalina.home=$tchome;-Dcatalina.base=$catbase;-Djava.io.tmpdir=$catbase\temp;-Duser.timezone=UTC;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=$catbase\conf\logging.properties`"",
" --StartMode jvm",
" --StopMode jvm",
" --StartClass `"org.apache.catalina.startup.Bootstrap`"",
" --StopClass `"org.apache.catalina.startup.Bootstrap`"",
" --StartParams start",
" --StopParams stop",
" --Classpath `"$tchome\bin\bootstrap.jar;$tchome\bin\tomcat-juli.jar`""
)
#Convert the string to a scriptblock object
[scriptblock]$servicecommand = [scriptblock]::Create($servicecommandstring)
#Run the command.
Invoke-Command -ScriptBlock $servicecommand
Please let us know if this is indeed a requirement going forward as this
information normally get passed in the --JvmOption section pointing to location
of the conf\logging.properties file
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]