Bug 858138 - rhq-agent-env.sh gives example of bad su command
rhq-agent-env.sh gives example of bad su command
Product: RHQ Project
Classification: Other
Component: Launch Scripts (Show other bugs)
All Linux
unspecified Severity low (vote)
: ---
: RHQ 4.6
Assigned To: Thomas Segismont
Mike Foley
Depends On:
Blocks: 864239
  Show dependency treegraph
Reported: 2012-09-18 02:29 EDT by James Livingston
Modified: 2016-02-21 19:56 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 864239 (view as bug list)
Last Closed: 2013-09-03 10:42:13 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)

  None (edit)
Description James Livingston 2012-09-18 02:29:09 EDT
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 directory.

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-03 17:25:16 EST
The RHQ_AGENT_START_COMMAND variable example is like this in the script since its introduction on 14/12/2008.

Before that, one was only able to prefix the agent start command. And the given example was:
Comment 2 Thomas Segismont 2012-12-10 04:30:34 EST
Removed -l option from RHQ_AGENT_START_COMMAND example.
Beware though that the user should not define env variables in the JBoss user shell startup files (no login).

master 1cdbda2
Comment 3 Heiko W. Rupp 2013-09-03 10:42:13 EDT
Bulk closing of issues in old RHQ releases that are in production for a while now.

Please open a new issue when running into an issue.

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