Earlier today I did a demo of the new rhqctl script being developed in the feature/cassandra-backend branch. Here are links for some initial docs and for the demo on youtube.


https://www.youtube.com/watch?feature=player_embedded&v=sFXYMHV-e04
https://docs.jboss.org/author/display/RHQ/RHQ+Control+Script

I consolidated the Q&A from the demo below.

Question
Can I see the script without building the whole source tree?

Answer
The script can be found in the source tree at <RHQ_ROOT>/modules/enterprise/server/appserver/src/main/bin-resources/bin but you will need to build the source in order for it to be usable. In particular you will need to build the feature/cassandra-backend branch.


Question
Is it possible for the logs of the different services to become intertwined?

Answer
With the install command, services log to both stdout and to their own log files. rhqctl installs thing serially which should help limit the possibility of seeing log messages interwoven on stdout. rhqctl first installs the storage node and then waits until it is up and running (in the background) and read to accept client connections before proceeding. Then it moves onto the server installation. The agent is install is not started until rhqctl verifies that the server is fully initialized where you can log in via the web UI. This approach should help with reducing the chances of getting log output mixed up.


 Question
Where are the pid files stored? Are the locations configurable? What about for RPM?

Answer
The default location for pid files is <RHQ_SERVER>/bin for the server, <RHQ_AGENT>/bin for the agent, and <RHQ_STORAGE>/bin for the storage node. The server and agent pid location is customizable via environment variables. Currently the storage node is installed with the cassandra script and the location of its pid can be specified with a command line option. We will implement an rhq-storage.(sh|bat) script with behavior consistent with that of the server and agent scripts.


Question
Are there equivalent files like rhq-server.properties or is everything integrated into one common file?

Answer
There is no common, shared config file. When rhqctl installs the agent, it updates the rhq.agent.server.bind-address property in agent-configuration.xml. And for the storage node, rhqctl delegates to rhq-storage-installer.sh which updates <RHQ_STORAGE>/conf/cassandra.yaml.


Question
How does this work on Windows?

Answer
The rhqctl script has not been ported to Windows yet. The bulk of the functionality is implemented in Java and is deployed as a JBoss module. This will hopefully reduce the effort in porting it to Windows as well as the overall maintenance. The rhqctl.sh script itself should be very easy to port. We need to test on Windows to see what if any changes are needed in the Java code in order to provide consistent behavior and functionality on both Linux and Windows platforms.


Question
Can launch preferences be stored so that only certain processes are run? e.g. I only want to run the agent + storage on a machine.

Answer
I have updated the server installer to generate a file marker at the end of a successful install. rhqctl looks for that marker to determine if the server has been installed. If you haven't installed the server, i.e., that marker does not exist, then rhqctl would only ever start agent + storage. Assuming you have installed the server, then there will be a config file of some sort where we could tell rhqctl to only ever start agent + storage. This not yet implemented though.


Question
What happens if an agent is installed already and you try installing with --storage?

Answer
Only the storage node will be installed. When you pass the --storage option to the install command, rhqctl will install the storage node and then if the agent is not already installed, it will install the agent.


Question
What happens when running "rhqctl console --server --agent"? Do the log messages interleave?

Answer
That is in invalid command line for the console command. rhqctl will simply display the usage/help and exit.


Question
Can I assume that the rhqctl script just delegates to scripts we already have?

Answer
yes


Question
Can the agent shell be broken out into a different command which connects to a running agent?

Answer
What is being asked is being able to "log in" to an agent similar to how you ssh into a machine. There is no functionality like that today in the agent. It is definitely possible though. I have already done a little work with piping input/output streams to get "rhqctl console --agent" working. There is still work to be done to get it functioning properly. Once that is in place though, it shouldn't be too much effort to redirect I/O from streams other than stdin/stdout.


Question
How would rhqctl work with storage running under a different user than the user who runs the agent?


Answer
This is a tough one when considering a primary objective of rhqctl is to just to the right thing while keeping things simple for the user. Suppose I run "rhqctl start" and I have perms for the storage node but not for the agent. Is the right thing here for rhqctl to start the storage node and log a warning that the user doesn't have perms? Or should rhctl just start the storage node and ignore the agent since the user doesn't have perms. I prefer logging the warning by default. When we provide some sort of launch preferences of config file for rhqctl, then the user could use that to tell rhqctl to only start the storage node so that the user won't see warning messages about the agent.


Question
How would you start everything at boot time?

Answer
I need to see what if any changes are needed so that rhqctl.sh can be used with init.d. The rhq-storage.sh script will be implemented as an init.d script just like rhq-server.sh. We use the Java service wrapper for Windows which only supports a 32 bit JVM. Stefan and I plan to investigate PowerShell to see if it offers any options that might be worth pursuing.