From owner-freebsd-rc@FreeBSD.ORG Tue Mar 27 18:19:58 2012 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08DD7106566B for ; Tue, 27 Mar 2012 18:19:58 +0000 (UTC) (envelope-from bsd-src@helfman.org) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id A85D58FC12 for ; Tue, 27 Mar 2012 18:19:57 +0000 (UTC) Received: by ggnk4 with SMTP id k4so244055ggn.13 for ; Tue, 27 Mar 2012 11:19:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-operating-system :organization:x-living-the-dream:x-pgp-fingerprint:x-pgp-key :user-agent:x-gm-message-state; bh=c9jBs6XxLfyx0QN/LShQb248lOe50K3LIluEyILQBs8=; b=IDRWxOkIqexzEeHEPpKsqFs55OiNSBNehnttrIksfAErlEU9pZa584q8Pny3zm2Ify bBuajW2UTnbNWgyPCxkAa7CIp7A8ldooxX9m7pKZYSy+SZ9xK1zEPtxJf4LkFwz1sxTD i1KDQ7QMfS9Rw0VC2h2LSrfm0W/s1N7SLTDeappC0YYA6RPq0mm7TvutvmtBB/FnxTWD o0QxOa9PWKl4+ItN70103qAIr/t0pjJ4abZ1yXGEaM7AutUGEskaFY8kMziShvZ7r1PK pdExXS1rtmus1NYLa8hzqp1ZgyOQ2o2RgvkVE65TAStAQVktivnoz4nNOamJUIqI+qIT qBIQ== Received: by 10.60.0.196 with SMTP id 4mr33792688oeg.0.1332872396913; Tue, 27 Mar 2012 11:19:56 -0700 (PDT) Received: from dormouse.experts-exchange.com ([72.29.164.238]) by mx.google.com with ESMTPS id c6sm432075oec.13.2012.03.27.11.19.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Mar 2012 11:19:55 -0700 (PDT) Sender: Jason Helfman Date: Tue, 27 Mar 2012 11:18:59 -0700 From: Jason Helfman To: Muhammad Moinur Rahman <5u623l20@gmail.com> Message-ID: <20120327181859.GD82277@dormouse.experts-exchange.com> References: <1332869146.439481.86668.nullmailer@experts-exchange.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 8.2-RELEASE amd64 Organization: The FreeBSD Project, http://www.freebsd.org X-Living-The-Dream: I love the SLO Life! X-PGP-FingerPrint: 8E0D C457 9A0F C91C 23F3 0454 2059 9A63 4150 D3DC X-PGP-Key: http://people.freebsd.org/~jgh/jgh.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkkgNIglnTOQaYuYbfPV9ZAr2iCXTM9+XC8Fgq+PhO5FS0DjCxLKOTIJmlC89wJmyNgQKhj Cc: rc@freebsd.org, bug-followup@freebsd.org Subject: Re: [PATCH] www/resin3: reorganize rc script X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2012 18:19:58 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Wed, Mar 28, 2012 at 12:10:58AM +0600, Muhammad Moinur Rahman thus spake: >Hi Jason, > >Good to see you again. :D Good to see you too :) > >As far as I remember we got rid off the users problem running the >application with www user and group. In that case don't you think we can >get rid off the following variables from the rc file : > >+%%APP_NAME%%_user=${%%APP_NAME%%_user:-"%%USERS%%"} >+%%APP_NAME%%_group=${%%APP_NAME%%_group:-"%%GROUPS%%"} > >Let me know your opinion please. > >Regards, >Muhammad We didn't get rid of the USERS/GROUPS usage, though. We are using both of these, but using the www user and www group. Since it isn't configurable now, though, you have a a point, so it should at least be non-configurable in the rc script. Included is an updated patch. -jgh -- Jason Helfman | FreeBSD Committer jgh@FreeBSD.org | http://people.freebsd.org/~jgh --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="newpatch.txt" Index: Makefile =================================================================== RCS file: /home/pcvs/ports/www/resin3/Makefile,v retrieving revision 1.46 diff -u -r1.46 Makefile --- Makefile 14 Mar 2012 18:09:37 -0000 1.46 +++ Makefile 27 Mar 2012 18:17:47 -0000 @@ -7,6 +7,7 @@ PORTNAME= resin PORTVERSION= 3.1.12 +PORTREVISION= 1 CATEGORIES= www java MASTER_SITES= http://www.caucho.com/download/ @@ -44,7 +45,7 @@ # Other settings APXS?= ${LOCALBASE}/sbin/apxs SUB_FILES= pkg-message resin3ctl -USE_RC_SUBR= resin3.sh +USE_RC_SUBR= resin3 .include Index: files/resin3.in =================================================================== RCS file: files/resin3.in diff -N files/resin3.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/resin3.in 27 Mar 2012 18:17:47 -0000 @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $FreeBSD: ports/www/resin3/files/resin3.sh.in,v 1.1 2012/03/13 16:29:23 jgh Exp $ +# + +# PROVIDE: %%APP_NAME%% +# REQUIRE: LOGIN NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable %%APP_NAME%%: +# +# %%APP_NAME%%_enable="YES" +# + + +%%APP_NAME%%_enable=${%%APP_NAME%%_enable:-"NO"} +%%APP_NAME%%_user=${%%APP_NAME%%_user:"www"} +%%APP_NAME%%_group=${%%APP_NAME%%_group:"www"} + +. /etc/rc.subr + +name=%%APP_NAME%% +rcvar=%%APP_NAME%%_enable + +load_rc_config ${name} + +command="%%PREFIX%%/sbin/%%APP_NAME%%ctl" +command_args="start" +pidfile=%%PID_FILE%% + +if test -n "${%%APP_NAME%%_java_version}" ; then + JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +else + JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +fi + +export JAVA_HOME + +run_rc_command "$1" Index: files/resin3.sh.in =================================================================== RCS file: files/resin3.sh.in diff -N files/resin3.sh.in --- files/resin3.sh.in 13 Mar 2012 16:29:23 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,43 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/www/resin3/files/resin3.sh.in,v 1.1 2012/03/13 16:29:23 jgh Exp $ -# - -# PROVIDE: %%APP_NAME%% -# REQUIRE: LOGIN -# KEYWORD: shutdown - -# -# Add the following line to /etc/rc.conf to enable %%APP_NAME%%: -# -# %%APP_NAME%%_enable="YES" -# - -. /etc/rc.subr - -name=%%APP_NAME%% -rcvar=%%APP_NAME%%_enable - -command="%%PREFIX%%/sbin/%%APP_NAME%%ctl" -command_args="start" -pidfile=%%PID_FILE%% - -# set defaults - -%%APP_NAME%%_enable=${%%APP_NAME%%_enable:-"NO"} -%%APP_NAME%%_user=${%%APP_NAME%%_user:-"%%USERS%%"} -%%APP_NAME%%_group=${%%APP_NAME%%_group:-"%%GROUPS%%"} - -load_rc_config ${name} - -if test -n "${%%APP_NAME%%_java_version}" ; then - JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) - procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) -else - JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) - procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) -fi - -export JAVA_HOME - -run_rc_command "$1" --2oS5YaxWCcQjTEyO--