Bug 1074610 - JON 3.2.0 install fails if the install user account has no home directory
Summary: JON 3.2.0 install fails if the install user account has no home directory
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Installer
Version: JON 3.2
Hardware: All
OS: Linux
unspecified
high
Target Milestone: DR01
: JON 3.3.0
Assignee: Libor Zoubek
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-10 16:05 UTC by Lami Akagwu
Modified: 2015-11-02 00:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-11 14:04:35 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 739963 None None None Never

Description Lami Akagwu 2014-03-10 16:05:28 UTC
Description of problem:

Start installation using rhqctl install --start
Console error during agent installation
----

INFO  [org.rhq.server.control.command.Install] Configuring the RHQ agent with default configuration file: /opt/jboss/jon/rhq-agent/conf/agent-configuration.xml
ERROR [org.rhq.server.control.command.Install] An error occurred while configuring the agent: Couldn't get file lock.
ERROR [org.rhq.server.control.RHQControl] Couldn't get file lock.
----
Full agent console log snippet

===== RHQ AGENT INSTALL =====
Installing Agent To: /opt/jboss/jon
Version: 4.9.0.JON320GA
Build Number: 734bd56
Jar File: /opt/jboss/jon/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent/rhq-enterprise-agent-4.9.0.JON320GA.jar
[install] [echo] Extract the agent distro zip from the agent update binary
[install] [unjar] Expanding: /opt/jboss/jon/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent/rhq-enterprise-agent-4.9.0.JON320GA.jar into /opt/jboss/jon/jon-server-3.2.0.GA
[install] [echo] Unzip the agent distro into the new installation directory
[install] [unzip] Expanding: /opt/jboss/jon/jon-server-3.2.0.GA/rhq-enterprise-agent-4.9.0.JON320GA.zip into /opt/jboss/jon
[install] [echo] chmod +x on executables under /opt/jboss/jon/rhq-agent
[install] [echo] Remove the agent distro zip
[install] [delete] Deleting: /opt/jboss/jon/jon-server-3.2.0.GA/rhq-enterprise-agent-4.9.0.JON320GA.zip
[install] [echo] DONE! Agent version 4.9.0.JON320GA (build number=734bd56) has been installed to /opt/jboss/jon
10:47:23,003 INFO  [org.rhq.server.control.command.Install] The agent installer finished running with exit value 0
10:47:23,004 INFO  [org.rhq.server.control.command.Install] Configuring the RHQ agent with default configuration file: /opt/jboss/jon/rhq-agent/conf/agent-configuration.xml
10:47:24,579 ERROR [org.rhq.server.control.command.Install] An error occurred while configuring the agent: Couldn't get file lock.
10:47:24,581 ERROR [org.rhq.server.control.RHQControl] Couldn't get file lock.
10:47:24,582 WARN  [org.rhq.server.control.command.Install] UNDO: Removing agent install directory
10:47:24,599 WARN  [org.rhq.server.control.command.Install] UNDO: Removing server-installed marker file and management user
10:47:24,600 WARN  [org.rhq.server.control.command.Install] UNDO: Stopping component: --server
Trying to stop the RHQ Server...
RHQ Server (pid=11557) is stopping..

Version-Release number of selected component (if applicable):


How reproducible:


***Steps to Reproduce:***
As root

1) Create directory in /opt
mkdir /opt/jboss

2) Add group called jboss
groupadd jboss

3) Add user jbossadmin without home directory and assign user to group jboss
useradd -r -s /bin/false -g jboss jonadmin 

4) Grant group jboss rwx /opt/jboss and su jonadmin

5) Unzip JON 3.2.0 to /opt directory
   rhqctl install --start

Actual results:
Agent install fails

Expected results:
If agent install fails the log entry should contain sufficient information to allow the user to fix the problem.

Additional info:
Workaround is to set RHQ_CONTROL_ADDITIONAL_JAVA_OPTS="-Djava.util.prefs.userRoot=/some-path/ but this is not obvious from the console error message

Comment 2 Libor Zoubek 2014-06-30 16:01:40 UTC
in master

commit 9220b2338d26406e547b7e7c68d3747a20d5d5e8
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Mon Jun 30 17:58:15 2014 +0200

    [BZ 1074610] JON 3.2.0 install fails if the install user account has no home
    directory
    
    Log error message with possible hint when we fail to write agent
    preferences.

Comment 3 Simeon Pinder 2014-07-31 15:52:11 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 4 Sunil Kondkar 2014-08-06 13:51:15 UTC
Verified on JON 3.3 DR01 build.

Agent install fails with below message:

19:16:02,812 ERROR [org.rhq.server.control.command.Install] Failed to store agent preferences, for Linux systems we require writable user.home [/home/jonadmin]. You can also set different location for agent preferences by setting "-Djava.util.prefs.userRoot=/some/path/" java system property. You may need to put this property to RHQ_CONTROL_ADDIDIONAL_JAVA_OPTS and RHQ_AGENT_ADDIDIONAL_JAVA_OPTS env variables.


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