Bug 159695

Summary: [patch] www/tomcat6: configurable user/groups breaks if configured
Product: Ports & Packages Reporter: Jason Helfman <jhelfman>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
tomcat6.patch.txt none

Description Jason Helfman 2011-08-11 18:40:07 UTC
Using a different user/group for tomcat6, breaks installation.
This patch removes configurability. (tomcat6/files/pkg-install.in, dead (with patch))

How-To-Repeat: Add to /etc/make.conf (or use make arguments)

.if ${.CURDIR:M*/www/tomcat6}
TOMCAT_USER=www1
TOMCAT_GROUP=www1
.endif

Result:
[jhelfman@eggman /usr/ports/www/tomcat6]$ sudo make
===>  License ASL accepted by the user
===>  Extracting for tomcat-6.0.32
=> SHA256 Checksum OK for apache-tomcat-6.0.32.tar.gz.
===>  Patching for tomcat-6.0.32
Installation settings:
   Destination directory:    /usr/local/apache-tomcat-6.0
   Location of JDK:          /usr/local/diablo-jdk1.6.0
   Location of Java port:    java/diablo-jdk16
   Running as (user/group):  www1/www1
   HTTP port:                8180
   Shutdown listener port:   8005
   AJP 1.3 connector port:   8009
   Logfile stdout:           /usr/local/apache-tomcat-6.0/logs/stdout.log
   Logfile stderr:           /usr/local/apache-tomcat-6.0/logs/stderr.log
===>  Applying FreeBSD patches for tomcat-6.0.32
===>  Configuring for tomcat-6.0.32
[jhelfman@eggman /usr/ports/www/tomcat6]$ sudo make install
===>  Installing for tomcat-6.0.32
===>   tomcat-6.0.32 depends on file: /usr/local/diablo-jdk1.6.0/bin/java - found
pw: gid `80' has already been allocated
Added group "www1".
pw: uid `80' has already been allocated
Added user "www1".
===>   Generating temporary packing list
===>  Checking if www/tomcat6 already installed
 >> Creating destination directory... [ DONE ]
 >> Copying files to destination directory... [ DONE ]
 >> Creating symlink to tools.jar... [ DONE ]
 >> Fixing ownership settings... [ DONE ]
 >> Fixing permissions... [ DONE ]
 ===> Installing rc.d startup script(s)
 ===>   Registering installation for tomcat-6.0.32
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-08-11 18:40:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Jason 2011-08-11 18:50:44 UTC
Here is an updated patch, as I noticed that www/tomcat7 isn't using the same
method for users/groups, and is using the default www user. So I've removed
it, and updated startup script, as well. Please ignore previous patch, as
this one includes the previous information, as well.

Thanks!

-- 
Jason Helfman
System Administrator
experts-exchange.com
http://www.experts-exchange.com/M_4830110.html
E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2011-08-12 11:08:21 UTC
State Changed
From-To: open->closed

I cannot see what is broken and removing a feature is not a fix :-)
Comment 4 Chris Rees 2011-08-12 17:22:06 UTC
The problem Jason has seen is that unfortunately, while previously one 
could override the port's choice of user when it was created it is no 
longer practical to do that when the port uses USERS.

The code in bsd.port.mk gets confused when you try to override the 
choice of UID, partly because it uses the ${PORTSDIR}/UIDs file -- it 
definitely is a problem.

Is there a special reason this feature is desirable?

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Comment 5 Alex Dupre freebsd_committer freebsd_triage 2011-08-16 08:12:48 UTC
And in fact tomcat6 doesn't use USERS.

The reason is POLA, I've inherited this port, as you can see tomcat7 is 
completely different.

-- 
Alex Dupre