-
1. Re: Test if JBoss is running as service (prior to CLI config)
drakemj Sep 7, 2012 2:48 PM (in response to drakemj)What I wasn't thinking when I originally wrote this post is that service start does not imply full JBoss start. What I really needed to know is whether JBoss was running to an extent considered satisfactory by the CLI tool. This is a different thing altogether from whether Windows thinks the service is running.
The most reliable approach was determined to be an NSIS function which performs a JBoss "ping", accomplished by executing a simple CLI script that attempts a connect command. If the connection failed, JBoss is not running or not fully started. The function loops to make n ping attempts, sleeping between each attempt.
-
2. Re: Test if JBoss is running as service (prior to CLI config)
jaikiran Sep 10, 2012 1:29 AM (in response to drakemj)Melanie Drake wrote:
The most reliable approach was determined to be an NSIS function which performs a JBoss "ping", accomplished by executing a simple CLI script that attempts a connect command. If the connection failed, JBoss is not running or not fully started. The function loops to make n ping attempts, sleeping between each attempt.
A failed connection doesn't necessarily mean that the server isn't up. It might even mean that the CLI probably pinged a wrong port (probably changed on the server). But I guess, you have control over both the server and this CLI script and if the server side changed the port you would be able to update the CLI script accordingly.
-
3. Re: Test if JBoss is running as service (prior to CLI config)
nickarls Sep 10, 2012 2:27 AM (in response to drakemj)Another option could be to "cold configuring" it by running a seach/replace-script on the standalone.xml but I agree the CLI option is better as you could have a basic script run first and then run the customer-specific script.
Checking might be done with
set NOPAUSE=1
jboss-cli -c --command="read-attribute server-state" | find "running"