Bug 1337671

Summary: Oracle12c resource status check fails if username is longer than 8 characters in pacemaker cluster
Product: Red Hat Enterprise Linux 6 Reporter: Oyvind Albrigtsen <oalbrigt>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED NOTABUG QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: agk, cluster-maint, cluster-qe, ctowsley, fdinitto, jruemker, mnovacek, pzimek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1317578 Environment:
Last Closed: 2016-07-22 20:16:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1317578    
Bug Blocks: 1269194    

Description Oyvind Albrigtsen 2016-05-19 19:00:43 UTC
+++ This bug was initially created as a clone of Bug #1317578 +++

Description of problem:

Oracle resource agent for Oracle12c in RHEL 7 cluster contain status check which performs grep of "ps" output for Oracle user based on environment variable $ORACLE_OWNER. However if the $ORACLE_OWNER value contains more than 8 characters the `ps` cuts the username in output so the grep won't succeed causing status check to fail.


From sources of resource-agents (RHEL 7.1), ClusterLabs-resource-agents-5434e96/heartbeat/oralsnr:


269 show_procs() {
270     ps -e -o pid,user,args |
271         grep '[t]nslsnr' | grep -w "$listener" | grep -w "$ORACLE_OWNER"


EXAMPLE:
========
If $ORACLE_OWNER is "oracle123" it will be displayed in `ps -e -o pid,user,args` output as "oracle1+" and the check (above line #271) will fail causing the status check to fail.
========


"ps" offers -U <username> parameter to list only processes related to <username> so we could use it instead of grepping the user itself. The `ps -U $ORACLE_OWNER` should work also if the username is longer than 8 characters


Version:
RHEL 7.1, resource-agents-3.9.5

How reproducible:
Always

--- Additional comment from Oyvind Albrigtsen on 2016-03-16 13:02:13 CET ---

Tested and working as expected:
https://github.com/ClusterLabs/resource-agents/pull/781

Comment 2 John Ruemker 2016-07-22 20:16:18 UTC
This issue was resolved in the customer's environment by applying a fix to pacemaker that prevented an issue which incorrectly applied a COLUMN_WIDTH of 80 to pacemaker environments that was then getting handed down to the oralsnr agent.  So, to our knowledge there are no customers needing this for RHEL 6, and in fact I don't expect this bug should even be present in RHEL 6 assuming you're on a non-affected version of pacemaker.  

I'm going to close this out.  

-John