Bug 654160
| Summary: | clustat -v reports "clustat version DEVEL" on release package | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Ryan Mitchell <rmitchel> | ||||
| Component: | rgmanager | Assignee: | Lon Hohberger <lhh> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 5.5 | CC: | cluster-maint, djansa, edamato, hchiramm | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | rgmanager-2.0.52-12.el5 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-07-21 10:47:11 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Ryan Mitchell
2010-11-17 02:19:11 UTC
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 |