From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Aug 11 17:40:08 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A611065670 for ; Thu, 11 Aug 2011 17:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BAE9E8FC1F for ; Thu, 11 Aug 2011 17:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p7BHe7Yj055629 for ; Thu, 11 Aug 2011 17:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p7BHe7UG055628; Thu, 11 Aug 2011 17:40:07 GMT (envelope-from gnats) Resent-Date: Thu, 11 Aug 2011 17:40:07 GMT Resent-Message-Id: <201108111740.p7BHe7UG055628@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jason Helfman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFDB1065672 for ; Thu, 11 Aug 2011 17:38:33 +0000 (UTC) (envelope-from jhelfman@experts-exchange.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251]) by mx1.freebsd.org (Postfix) with ESMTP id BDD5C8FC1F for ; Thu, 11 Aug 2011 17:38:33 +0000 (UTC) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id AC3186FD4C9 for ; Thu, 11 Aug 2011 10:38:33 -0700 (PDT) Received: from mail.experts-exchange.com ([127.0.0.1]) by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vYVZzFSFNCbw for ; Thu, 11 Aug 2011 10:38:33 -0700 (PDT) Received: from experts-exchange.com (unknown [192.168.103.122]) by mail.experts-exchange.com (Postfix) with SMTP id 6DAC36FD4C8 for ; Thu, 11 Aug 2011 10:38:33 -0700 (PDT) Received: (nullmailer pid 38399 invoked by uid 1001); Thu, 11 Aug 2011 17:37:49 -0000 Message-Id: <1313084269.640339.38398.nullmailer@experts-exchange.com> Date: Thu, 11 Aug 2011 10:37:49 -0700 From: Jason Helfman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/159695: [patch] www/tomcat6: configurable user/groups breaks if configured X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jason Helfman List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 17:40:08 -0000 >Number: 159695 >Category: ports >Synopsis: [patch] www/tomcat6: configurable user/groups breaks if configured >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Aug 11 17:40:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Jason Helfman >Release: FreeBSD 8.2-RELEASE i386 >Organization: Experts Exchange, LLC. >Environment: System: FreeBSD eggman.experts-exchange.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: 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 >Fix: Index: www/tomcat6/Makefile =================================================================== RCS file: /home/jhelfman/ncvs/ports/www/tomcat6/Makefile,v retrieving revision 1.63 diff -u -r1.63 Makefile --- www/tomcat6/Makefile 12 Jun 2011 13:55:39 -0000 1.63 +++ www/tomcat6/Makefile 11 Aug 2011 17:27:48 -0000 @@ -7,6 +7,7 @@ PORTNAME= tomcat PORTVERSION= 6.0.32 +PORTREVISION= 1 CATEGORIES= www java MASTER_SITES= ${MASTER_SITE_APACHE} MASTER_SITE_SUBDIR= tomcat/tomcat-6/v${PORTVERSION}/bin @@ -23,14 +24,13 @@ NO_BUILD= YES USE_RC_SUBR= tomcat6.sh -SUB_FILES= pkg-install MAJOR_VER= ${PORTVERSION:R} APP_HOME?= ${PREFIX}/${DISTNAME:R} LOG_DIR= ${APP_HOME}/logs APP_SHORTNAME= ${PORTNAME}${MAJOR_VER:S/.//} -TOMCAT_USER?= www -TOMCAT_GROUP?= www +USERS= www +GROUPS= www HTTP_PORT?= 8180 SHUTDOWN_PORT?= 8005 AJP_1_3_PORT?= 8009 @@ -41,7 +41,7 @@ logging.properties server.xml tomcat-users.xml web.xml CONF_EXT= sample PLIST_SUB= T=${APP_HOME:S/^${PREFIX}\///} CONF_EXT=${CONF_EXT} \ - WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP} + WWWOWN=${USERS} WWWGRP=${GROUPS} LATEST_LINK= ${APP_SHORTNAME} SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \ @@ -54,8 +54,7 @@ STDERR_LOG=${STDERR_LOG} \ STDOUT_LOG=${STDOUT_LOG} \ TOMCAT_HOME=${APP_HOME} \ - TOMCAT_VERSION=${MAJOR_VER:S/.//} \ - USER=${TOMCAT_USER} + TOMCAT_VERSION=${MAJOR_VER:S/.//} .include @@ -64,7 +63,7 @@ @${ECHO_MSG} " Destination directory: ${APP_HOME}" @${ECHO_MSG} " Location of JDK: ${JAVA_HOME}" @${ECHO_MSG} " Location of Java port: ${JAVA_PORT}" - @${ECHO_MSG} " Running as (user/group): ${TOMCAT_USER}/${TOMCAT_GROUP}" + @${ECHO_MSG} " Running as (user/group): ${USERS}/${GROUPS}" @${ECHO_MSG} " HTTP port: ${HTTP_PORT}" @${ECHO_MSG} " Shutdown listener port: ${SHUTDOWN_PORT}" @${ECHO_MSG} " AJP 1.3 connector port: ${AJP_1_3_PORT}" @@ -78,9 +77,6 @@ @${MV} ${WRKSRC}/conf/${f} ${WRKSRC}/conf/${f}.${CONF_EXT} .endfor -pre-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - do-install: @${ECHO_MSG} -n ">> Creating destination directory..." @${MKDIR} ${APP_HOME} @@ -105,7 +101,7 @@ @${ECHO_MSG} " [ DONE ]" @${ECHO_MSG} -n ">> Fixing ownership settings..." - @${CHOWN} -R ${TOMCAT_USER}:${TOMCAT_GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \ + @${CHOWN} -R ${USERS}:${GROUPS} ${APP_HOME}/conf ${APP_HOME}/logs \ ${APP_HOME}/temp ${APP_HOME}/webapps ${APP_HOME}/work @${ECHO_MSG} " [ DONE ]" Index: www/tomcat6/files/pkg-install.in =================================================================== RCS file: www/tomcat6/files/pkg-install.in diff -N www/tomcat6/files/pkg-install.in --- www/tomcat6/files/pkg-install.in 7 Feb 2006 08:50:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ -#!/bin/sh -# -# Checks if the '%%USER%%' user and '%%GROUP%%' group exist. If they don't, then -# an attempt is made to create both. -# -# $FreeBSD: ports/www/tomcat6/files/pkg-install.in,v 1.1 2006/02/07 08:50:09 lawrance Exp $ -# - -# Make sure we're called during the 'make install' process -if [ "$2" != "PRE-INSTALL" ]; then - exit 0 -fi - -# Set some constants -UID=80 -GID=${UID} -USER=%%USER%% -GROUP=%%GROUP%% - -# See if the group already exists -if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then - - # If not, try to create it - if pw groupadd "${GROUP}" -g ${GID}; then - echo "Added group \"${GROUP}\"." - elif pw groupadd "${GROUP}"; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi -fi - -# See if the user already exists -if ! pw usershow "${USER}" 2>/dev/null 1>&2; then - - # If not, try to create it - if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \ - -s "/sbin/nologin" -d "/nonexistent" \ - -c "World Wide Web Owner"; - then - echo "Added user \"${USER}\"." - elif pw useradd "${USER}" -g "${GROUP}" -h - \ - -s "/sbin/nologin" -d "/nonexistent" \ - -c "World Wide Web Owner"; - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi -fi -exit 0 >Release-Note: >Audit-Trail: >Unformatted: >> 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