Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1367163 - Problem to start tomcat with a user whose group has a name different to the user
Summary: Problem to start tomcat with a user whose group has a name different to the user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: tomcat6, tomcat7
Version: 2.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 2.1.1
Assignee: Coty Sutherland
QA Contact: Jan Stefl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-15 18:09 UTC by fgoldefu
Modified: 2017-08-09 16:45 UTC (History)
3 users (show)

Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-09 16:45:55 UTC
Type: Bug


Attachments (Terms of Use)

Description fgoldefu 2016-08-15 18:09:39 UTC
Description of problem:

The /etc/init.d/tomcat script is not constructed to handle a user with a name that does not correspond to an existing group


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


How reproducible: Always


Steps to Reproduce:
1. Create a user (such as "test") on a system where the group "test" does not exist. For example, create with test:test1 configuration
2. Change the /etc/sysconfig/tomcat with TOMCAT_USER=test
3. Start /etc/init.d/tomcat6
  
Actual results:
The chown of the CATALINA_PID file failed
The tomcat can't write to the CATALINA_PID file 
It is impossible to stop tomcat with /etc/init.d/tomcat stop

Expected results:
The chown is done correctly and the start/stop of tomcat is operationnal

Comment 1 fgoldefu 2016-08-15 18:10:49 UTC
Regression of Bug 915447.

Comment 2 Coty Sutherland 2017-08-09 16:45:55 UTC
I'm closing this as closed/currentrelease because the reproduction steps describe yield a different result (you fail to write the log, but the pid file is OK) in the current release (JWS 3). The problem that was noted here was resolved by the following change in /etc/init.d/tomcat:

TOMCAT_GROUP="${TOMCAT_GROUP:-`id -gn ${TOMCAT_USER}`}"

which sets the TOMCAT_GROUP to the group of the user specified, not the same name as the user. However, if you don't chown the tomcat directories to the new user/group, then you'd fail to read the config or write the log which is what I saw when trying to reproduce. That is expected behavior IMO.


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