Description of problem: Due to the differences between what the old rhqserver script did and the new rhqctl script does and how its use will vary depending on the installed environment, we need to deprecate the existing rhqserver scripts in the following way: 1. The script should report an error indicating it has been deprecated and is no longer used. 2. The script should display information on how to do the equivalent command(s) using the new rhqctl script. 3. The script should return a non-zero error code to indicate a failure to any scripts or processes that may invoke it directly.
we still use the other scripts (rhq-server.sh, rhq-installer.sh). Its just that rhqctl wraps them. In fact, developers still do use rhq-server.sh (at least I do). However, what we should do is MOVE the old scripts to a location that doesn't confuse the users. For example, we discussed moving them to some subdirectory inside bin/ so the users don't see a cluttered bin/ directory with scripts that they probably don't need to use. somethign like "bin/internal". rhqctl and the underlying Java code it uses need to change to know to point to the new location for the scripts.
OK, I think I know what you are talking about. I think we can leave rhq-server.sh and rhq-installer.sh in the /bin directory but have it do as you say - report errors and all that. BUT have rhqctl code not even use those. It should call scripts in bin/internal. this way, people still using bin/rhq-server.sh or bin/rhq-installer.sh will be told that these are no longer used. But it doesn't matter to rhqctl because it doesn't even call those scripts - its calling scripts in bin/internal.
this is going to suck when it comes to upgrading, because now we have to check "if old server is 4.9, the scripts are in bin/ - otherwise, they are in bin/internal" This is going to require some good upgrade testing to make sure nothing breaks.
Are you saying that upgrading is copying scripts from the old install to the new?
*** Bug 1002221 has been marked as a duplicate of this bug. ***
git master commit: 3ef6782 Most scripts are now in bin/internal. The original scripts in bin/ are now obsolete ones that only spit out errors to tell people to use rhqctl instead now. This commit also fixed some problems with upgrading from RHQ 4.9.
Why are we leaving copies of original scripts in the bin the directory? That just seems like another source of confusion.
(In reply to John Sanda from comment #7) > Why are we leaving copies of original scripts in the bin the directory? That > just seems like another source of confusion. Ideally they should print the new command and "exit 1" so that the user knows what they would need to use instead. The exit code of 1 indicates that an error occurred and the user needs to look into it (e.g. when rhq-server.sh was copied to /etc/init.d to be used at system startup). I am reopening to add these usage hints. Target mile stone is er2 for now.
Moving into ER3 as didn't make it into ER2.
Currently the scripts do return exit code of 1, and print: This script is obsolete and no longer used. Use rhqctl instead. I guess I don't understand what it is you are looking for past this? We could be a little more verbose, I suppose. Maybe like: This script has been replaced by rhqctl. For help on the new command try: rhqctl --help Or visit the documentation at: https://docs.jboss.org/author/display/RHQ/RHQ+Control+Script ----------------------------------------------------------------------- Is that what you are looking for? If you are implying we need to translate the old command into a new command. I don't think that is worthwhile.
(In reply to Jay Shaughnessy from comment #10) > Currently the scripts do return exit code of 1, and print: > > This script is obsolete and no longer used. Use rhqctl instead. > > I guess I don't understand what it is you are looking for past this? We > could be a little more verbose, I suppose. Maybe like: > > This script has been replaced by rhqctl. For help on the new command try: > > rhqctl --help > > Or visit the documentation at: > > https://docs.jboss.org/author/display/RHQ/RHQ+Control+Script > > > ----------------------------------------------------------------------- > > Is that what you are looking for? If you are implying we need to translate > the old command into a new command. I don't think that is worthwhile. Do NOT put doc links in the output. That just causes pain in the JON builds because now we'd have to re-brand the scripts by altering them via JON build scripts to point to the JON doc URL as opposed to the RHQ doc URL. I like the "see rhqctl --help for more" - that could be useful.
From comment #0: > 2. The script should display information on how to do the equivalent command(s) using the new rhqctl script. The intention is to quickly provide the user with the next step(s). I think this might be sufficient: > This script has been replaced by rhqctl. For help on the new command try: > > rhqctl --help This takes care of 2. As mentioned, the old script also returns error code 1 which takes care of 3. The remaining question (1.) is does it report an error to stderr or not? For example: echo >&2 "ERROR: $0 has been replaced by rhqctl." cat <<EOF Please use rhqctl. For help on the new command try: rhqctl --help EOF This will allow the error to be seen on the console in the event that stdout is being redirected to a file and prevent redundancy in the event that stdout and stderr go to the same place.
I don't see a reason to block the release because of this. The solution is similar to EAP's solution (granted that EAP doesn't have installer command, just a run command and a bit more verbose). While I understand the concerns I actually think we should close and move on.
Moving into ER04 as not completed in ER03.
master commit bf886d871f336211846d4852032f089a54b0b6c7 - updated scripts with better messaging - updated .sh scripts with better handling of stderr release/jon3.2.x cherry pick commit 8e38e7d87f95b0f7a26f197ee2d7eac15315e33b
Moving to ON_QA for testing in the next build.
Verified on Version: 3.2.0.ER4 Build Number: e413566:057b211 Running the scripts (rhq-server.sh and rhq-installer.sh) display below in the console: ERROR: ./rhq-server.sh has been replaced by rhqctl. Please use rhqctl. For help on the new command try: rhqctl --help [root@sunillaptop bin]# ./rhq-installer.sh --help ERROR: ./rhq-installer.sh has been replaced by rhqctl. Please use rhqctl. For help on the new command try: rhqctl --help [root@sunillaptop bin]#