Bug 864239 - rhq-agent-env.sh gives example of bad su command
rhq-agent-env.sh gives example of bad su command
Product: JBoss Operations Network
Classification: JBoss
Component: Launch Scripts (Show other bugs)
JON 3.1.0
All Linux
medium Severity low
: ---
: JON 3.1.2
Assigned To: Thomas Segismont
Mike Foley
Depends On: 858138
  Show dependency treegraph
Reported: 2012-10-08 20:29 EDT by Larry O'Leary
Modified: 2013-09-11 06:59 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 858138
Last Closed: 2013-09-11 06:59:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 218333 None None None 2012-10-08 20:29:12 EDT

  None (edit)
Description Larry O'Leary 2012-10-08 20:29:11 EDT
+++ 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 04:37:13 EST
commit a9b76bf3cb25a329c00a7084a6f5583105c6b456
Author: Thomas SEGISMONT <tsegismo@redhat.com>
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 14:18:37 EST
Moving to ON_QA as new build available to test with:
Comment 3 Armine Hovsepyan 2012-12-14 09:49:04 EST
verified in JON 3.1.2 ER5

Note You need to log in before you can comment on or make changes to this bug.