Description of problem: EWS Tomcat installed as windows service is started by JON Tomcat by startup.bat in window not like windows service. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Install Tomcat as Windows service 2. Discovery it, import it to JON server 3. Schedule operation stop -> it stops Tomcat windows service 4. Wait 5. Schedule operation start -> it starts Tomcat in window not like windows service Actual results: Expected results: Additional info: The problem is that Tomcat plugin fills start/shutdown script field in JON with startup/shutdown.bat scripts.
It should be simply workarounded by creating scripts in CATALINA_HOME\bin directory and update startup/shutdown script filed in JON UI Tomcat configuration tab. For example create netstart.bat with net start Tomcat6 and netstop.bat with command net stop Tomcat6. It should go to Known issues.
The correct names of JON UI Tomcat configuration tab fields are: Start Script Shutdown Script
For properly installation and configuration of Tomcat Win service + JON Tomcat plugin you need follow these steps: Note: You need to install Tomcat and JON agent under same Windows user (for example hudson) 1. Install Tomcat as Windows service (jboss-ews-2.0\share\apache-tomcat-6.0.35\bin\service.bat install) 2. Create jmxremote.access (controlRole readwrite) and jmxremote.password (controlRole pwd) for example in jboss-ews-2.0\share\apache-tomcat-6.0.35\conf 3. Set owner of these two files to hudson 4. Enable JMX for Tomcat windows service: jboss-ews-2.0\sbin\tomcat6.exe //US//Tomcat6 ++JvmOptions="-Dcom.sun.management.jmxremote.port=8100;-Dcom.sun.management.jmxremote.access.file="c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat6\conf\jmxremote.access";-Dcom.sun.management.jmxremote.password.file="c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat6\conf\jmxremote.password";-Dcom.sun.management.jmxremote.ssl=false;-Dcom.sun.management.jmxremote.authenticate=true" 5. Create netstart.bat (net start Tomcat6) and netstop.bat (net stop Tomcat6) in bin directory 6. Start Tomcat win service: net start Tomcat6 or by netstart.bat - see the tomcat logs in logs directory. Tomcat win service should started. 7. Install and configure JON agent and type discovery in agent prompt - It should discover Tomcat windows service 8. go to JON UI - Inventory - Discovery Queue and import Tomcat and RHQ agent 9. Go to platforms and find your agent name and click on it 10. You are on your agent page and you see Tomcat Servers 11. Click on your Tomcat server and configure it (Inventory tab - Connection settings) 12. Fill Principal and Credentials (controlRole and pwd set in jmxremote files) 13. Update Start and Shutdown Script with your created bat files netstart.bat and netstop.bat 14. Click save 15. Update connection settings of Tomcat Server JVM - set Principal and Credentials 16. It should be all and you can manage your Tomcat Windows service from JON :)
forgot: 5.5 Set Log On for Tomcat Windows service to hudson - Go to Tomcat win service properties - Log On tab - and set user to hudson (it will run service under user hudson)
Doc Text added. @Jean-Frederic Clere, can you please review the Doc Text content?
Cause: When JBoss Enterprise Web Server Tomcat installed as windows service it should be started and stopped as a service (like net start tomcat6 and net stop tomcat6) but JON uses the startup.bat (and shutdown.bat) which starts Tomcat in a windows console. Consequence: Tomcat is started in a windows console instead as a service. Fix: This is known issue and as a workaround , create two scripts in CATALINA_HOME\bin directory and update startup/shutdown script fields in JBoss Operations Network interface Tomcat configuration tab.
Fixing 786082 should have fix this one...
VERIFIED on MS Windows Server 2008 (32bit) + JON 3.2.0.GA (update02) + JON Tomcat plugin (update01) + OracleJDK 1.6 + EWS ER4 Tomcat6/7
Correct settings for JON managing tomcat installed as windows service: Note: You need to install Tomcat and JON agent under same Windows user (for example hudson) 1. Install Tomcat as Windows service (jboss-ews-2.1\share\tomcat6\bin\service.bat install) 2. Create jmxremote.access (controlRole readwrite) and jmxremote.password (controlRole pwd) for example in C:\jmx directory 3. Set owner of these two files to SYSTEM and restrict access of jmxremote.password file only to user SYSTEM and set his rights only to read 4. Enable JMX for Tomcat windows service: jboss-ews-2.1\sbin\tomcat6.exe //US//Tomcat6 ++JvmOptions="-Dcom.sun.management.jmxremote.port=8100;-Dcom.sun.management.jmxremote.access.file="C:\jmx\jmxremote.access";-Dcom.sun.management.jmxremote.password.file="C:\jmx\jmxremote.password";-Dcom.sun.management.jmxremote.ssl=false;-Dcom.sun.management.jmxremote.authenticate=true" 6. Start Tomcat win service by Windows services application - see the tomcat logs in logs directory. Tomcat win service should started. 7. Install and configure JON agent and type discovery in agent prompt - It should discover Tomcat windows service 8. go to JON UI - Inventory - Discovery Queue and import Tomcat and RHQ agent 9. Go to platforms and find your agent name and click on it 10. You are on your agent page and you see Tomcat Servers 11. Click on your Tomcat server and configure it (Inventory tab - Connection settings) 12. Fill Principal and Credentials (controlRole and pwd set in jmxremote files) 13. Set Control Method to RPM System V init script (you can not set Start and Shutdown Script fields - leave it unset) 14. Click save 15. Update connection settings of Tomcat Server JVM - set Principal and Credentials 16. It should be all and you can manage your Tomcat Windows service from JON :)
Mandar, please document steps from comm#11
Removing need info. Cloned the bug for doc. New bug is 1128600.