Bug 858138 - rhq-agent-env.sh gives example of bad su command
Summary: rhq-agent-env.sh gives example of bad su command
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Launch Scripts
Version: 4.4
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
: RHQ 4.6
Assignee: Thomas Segismont
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 864239
TreeView+ depends on / blocked
 
Reported: 2012-09-18 06:29 UTC by James Livingston
Modified: 2016-02-22 00:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 864239 (view as bug list)
Environment:
Last Closed: 2013-09-03 14:42:13 UTC
Embargoed:


Attachments (Terms of Use)

Description James Livingston 2012-09-18 06:29:09 UTC
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 22:25:16 UTC
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:
  RHQ_AGENT_RUN_PREFIX=su -m - ${RHQ_AGENT_RUN_AS} -c

Comment 2 Thomas Segismont 2012-12-10 09:30:34 UTC
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 14:42:13 UTC
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.