Bug 864239

Summary: rhq-agent-env.sh gives example of bad su command
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Launch ScriptsAssignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: medium    
Version: JON 3.1.0CC: ahovsepy, jlivings, myarboro
Target Milestone: ---   
Target Release: JON 3.1.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 858138 Environment:
Last Closed: 2013-09-11 10:59:34 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: 858138    
Bug Blocks:    

Description Larry O'Leary 2012-10-09 00:29:11 UTC
+++ This bug was initially created as a clone of RHQ Bug #858138 +++

In rhq-agent-env.sh there is an example of setting RHQ_AGENT_START_COMMAND, which is useful when you use the wrapper script to run it as a service on RHEL. The example is gives is problematic causing it not to work correctly:
  RHQ_AGENT_START_COMMAND="su -m -l user -c '${RHQ_AGENT_HOME}/bin/rhq-agent.sh'"


The -l option overrides -m, and the result is that the environment is not propagated. When using the wrapper script as a SysV init script, the RHQ_AGENT_IN_BACKGROUND variable will be missing, so the pid file will be written into the wrong directly.

Removing the -l option fixes that, but I'm not 100% certain why it was there beyond it being common.

Comment 1 Thomas Segismont 2012-12-10 09:37:13 UTC
commit a9b76bf3cb25a329c00a7084a6f5583105c6b456
Author: Thomas SEGISMONT <tsegismo>
Date:   Mon Dec 10 10:20:00 2012 +0100

    Bug 864239 rhq-agent-env.sh gives example of bad su command
        (cherry-picked from 1cdbda2, bug 858138)
    -l overrides -m behavior in RHQ_AGENT_START_COMMAND example

Comment 2 Simeon Pinder 2012-12-13 19:18:37 UTC
Moving to ON_QA as new build available to test with:
https://brewweb.devel.redhat.com/buildinfo?buildID=247371

Comment 3 Armine Hovsepyan 2012-12-14 14:49:04 UTC
verified in JON 3.1.2 ER5