Bug 817100 - Agent PID file cannot be created during startup (RPM installation - EC2)
Agent PID file cannot be created during startup (RPM installation - EC2)
Product: RHQ Project
Classification: Other
Component: Configuration (Show other bugs)
Unspecified Unspecified
medium Severity unspecified (vote)
: ---
: JON 3.1.0
Assigned To: Stefan Negrea
Mike Foley
Depends On: 816000
Blocks: 707235 837381
  Show dependency treegraph
Reported: 2012-04-27 13:37 EDT by Stefan Negrea
Modified: 2013-09-03 11:12 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 816000
Last Closed: 2013-09-03 11:12: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)

  None (edit)
Description Stefan Negrea 2012-04-27 13:37:01 EDT
Description of problem:
The agent service cannot create the PID file during startup due to inssuficient file permissions to write to /var/run. The agent is started under a non-root username (created during the installation process).

How reproducible:

Steps to Reproduce:
1. Install JON Agent RPM for EC2
2. Try to start the service
Actual results:
The agent gets started but cannot create the PID file and is reporting an error.

Expected results:
The agent gets started and the PID file gets created.

Additional info:
The solution is to create a subfolder under /var/run that has write permissions for the agent user.
Comment 1 Mike Foley 2012-04-30 12:02:12 EDT
triaged 4/30/2012 by loleary, ccrouch, mfoley
Comment 2 Stefan Negrea 2012-05-01 08:24:45 EDT
The EC2 startup script does not implement recent changes that force the agent to run under a non-root username when started as a service. When the EC2 RPM is installed, the agent service runs with root privileges. For comparison, the non-EC2 version of the RPM uses 'su' to switch to a pre-configured non-privileged account at startup. 

This issue will be applicable to the EC2 RPM once the transition is made from root to non-root accounts. The folder to store PID files if the agent is not run with root privileges is /var/run/jboss-on/agent.

As long as the startup script for EC2 RPM starts the agent service with root-privileges this is a non-issue.
Comment 7 Stefan Negrea 2012-07-10 12:28:23 EDT
Updated ec2 agent init script to match functionality implemented in the regular init script with regards to PID file location, downgrading the executing user, and file ownership. The ec2 specific functionality was not touched or changed.
Comment 8 Stefan Negrea 2012-07-26 05:14:38 EDT
The pid file for the ec2 installation will be stored in /var/run/jboss-on/agent-ec2 to distinguish from the regular agent installation. This will prevent confusion regarding which service is running at any given time.
Comment 9 Armine Hovsepyan 2012-07-26 05:29:33 EDT
Comment 10 Heiko W. Rupp 2013-09-03 11:12:34 EDT
Bulk closing of old issues in VERIFIED state.

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