Description of problem: Running "clustat -v" shows that the package is a DEVEL version. This has concerned customers who are not sure if they are using a development or production package. Version-Release number of selected component (if applicable): rgmanager-2.0.52-6.el5_5.8 How reproducible: Reproduced in-house Steps to Reproduce: 1. Configure Red Hat Enterprise Linux 5 cluster 2. Run "clustat -v" command. 3. Observe output: # clustat -v clustat version DEVEL Actual results: clustat version DEVEL Expected results: clustat version 2.0.52 Additional info: Version is correctly displayed on RHEL6 clustat.
Seems RELEASE_VERSION is not defined: src/utils/clustat.c: 1126 #ifdef RELEASE_VERSION 1127 printf("%s version %s\n", basename(argv[0]), 1128 RELEASE_VERSION); 1129 #else 1130 printf("%s version DEVEL\n", basename(argv[0])); 1131 #endif Not entirely sure where it is supposed to be defined.
=== In Red Hat Customer Portal Case 00381827 === --- Comment by Mitchell, Ryan on 11/25/2010 2:22 PM --- 1) The behavior changed on the introduction of rgmanager-2.0.38-2.el5. - working in rgmanager-2.0.31-1.el5_1.1: # rpm -q rgmanager rgmanager-2.0.31-1.el5_1.1 # clustat -v clustat version 2.0.31 - failing in rgmanager-2.0.38-2.el5 # rpm -q rgmanager rgmanager-2.0.38-2.el5 # clustat -v clustat version DEVEL 2) The code in question is: src/utils/clustat.c: 1125 case VERSION_ONLY: 1126 #ifdef RELEASE_VERSION 1127 printf("%s version %s\n", basename(argv[0]), 1128 RELEASE_VERSION); 1129 #else 1130 printf("%s version DEVEL\n", basename(argv[0])); 1131 #endif 3) I looked at the code for clusvcadm: src/utils/clusvcadm.c: 318 case 'v': 319 printf("%s\n",PACKAGE_VERSION); 320 return 0; It returns the PACKAGE_VERSION, rather than RELEASE_VERSION. 4) The makefile defines PACKAGE_VERSION, but there is no mention of RELEASE_VERSION: src/utils/Makefile: 21 CFLAGS+= -DPACKAGE_VERSION=\"${RELEASE}\" 5) I created the following patch: $ cat bz654160-set-release-version.patch --- a/rgmanager/src/utils/clustat.c 2010-11-25 12:48:28.894761279 +1000 +++ b/rgmanager/src/utils/clustat.c 2010-11-25 12:53:00.074763701 +1000 @@ -1123,9 +1123,9 @@ main(int argc, char **argv) ret = !(cman_is_quorate(ch)); goto cleanup; case VERSION_ONLY: -#ifdef RELEASE_VERSION +#ifdef PACKAGE_VERSION printf("%s version %s\n", basename(argv[0]), - RELEASE_VERSION); + PACKAGE_VERSION); #else printf("%s version DEVEL\n", basename(argv[0])); #endif 6) After creating a package with this patch, clustat now shows the correct version: # rpm -q rgmanager rgmanager-2.0.52-6.8.bz654160 # clustat -v clustat version 2.0.52
Created attachment 462805 [details] Patch to report version correctly from clustat
Note: The output of clustat -v isn't a reliable indicator of the output format of clustat when run in text mode. Machine-readable output is available using 'clustat -x', which has been consistent for years.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-1000.html