From owner-freebsd-ports@FreeBSD.ORG Sun Jun 4 19:18:53 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAE1416AD86 for ; Sun, 4 Jun 2006 19:18:53 +0000 (UTC) (envelope-from paul.murphy@cogeco.ca) Received: from fep4.cogeco.net (smtp.cogeco.net [216.221.81.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1117743D68 for ; Sun, 4 Jun 2006 19:18:42 +0000 (GMT) (envelope-from paul.murphy@cogeco.ca) Received: from mercury.upton.net (d141-24-210.home.cgocable.net [24.141.24.210]) by fep4.cogeco.net (Postfix) with ESMTP id 38F487B5D; Sun, 4 Jun 2006 15:18:41 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mercury.upton.net (Postfix) with ESMTP id B5DF060E7; Sun, 4 Jun 2006 15:21:55 -0400 (EDT) X-Virus-Scanned: amavisd-new at upton.net Received: from mercury.upton.net ([127.0.0.1]) by localhost (mercury.upton.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZVUl4H38zj50; Sun, 4 Jun 2006 15:19:21 -0400 (EDT) Received: from [127.0.0.1] (earth.upton.net [192.168.0.3]) by mercury.upton.net (Postfix) with ESMTP id 76DD660D2; Sun, 4 Jun 2006 15:19:10 -0400 (EDT) Message-ID: <44833160.8040709@cogeco.ca> Date: Sun, 04 Jun 2006 15:15:44 -0400 From: Paul Murphy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: =?ISO-8859-1?Q?K=F6vesd=E1n_G=E1bor?= References: <447F68B4.7050503@cogeco.ca> <44830D96.3060809@t-hosting.hu> In-Reply-To: <44830D96.3060809@t-hosting.hu> Content-Type: multipart/mixed; boundary="------------090309030200050503040801" X-Antivirus: avast! (VPS 0622-4, 02/06/2006), Outbound message X-Antivirus-Status: Clean X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-ports@freebsd.org Subject: Re: security/amavisd-new startup script X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2006 19:18:56 -0000 This is a multi-part message in MIME format. --------------090309030200050503040801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable K=F6vesd=E1n G=E1bor wrote: > Paul Murphy wrote: >> I need to keep the amavisd-new pid file in a location other than the=20 >> default (/var/amavis/amavisd.pid), so I have rewritten the amavis rc=20 >> script to include a knob for 'pidfile'. Please consider the attached=20 >> file for the amavisd-new port. >> ----------------------------------------------------------------------= -- >> >> #!/bin/sh >> # >> # $FreeBSD: ports/security/amavisd-new/files/amavisd.sh.in,v 1.3=20 >> 2006/02/20 20:47:36 dougb Exp $ >> # >> >> # PROVIDE: amavisd >> # REQUIRE: LOGIN >> # BEFORE: mail >> # KEYWORD: shutdown >> >> # >> # Add the following lines to /etc/rc.conf to enable amavisd: >> # >> #amavisd_enable=3D"YES" >> # >> >> . /etc/rc.subr >> >> name=3Damavisd >> rcvar=3D`set_rcvar` >> >> load_rc_config $name >> >> # Set defaults >> : ${amavisd_enable:=3D"NO"} >> >> pidfile=3D${amavisd_pid:-"/var/amavis/amavisd.pid"} >> command=3D/usr/local/sbin/amavisd > /dev/null 2>&1 >> required_files=3D/usr/local/etc/amavisd.conf >> >> stop_postcmd=3Dstop_postcmd >> >> stop_postcmd() >> { >> rm -f $pidfile >> } >> >> run_rc_command "$1" >> =20 > I'd found this "new feature" a good idea first, but now, after a deeper= =20 > look, I realized that we can't set the pid file with a command-line=20 > option, just in the config file. Thus, if we wanted to use an alternate= =20 > location for a pid file, we would have to change it in two places: in=20 > amavisd.conf and in rc.conf. Accordingly, I think such modification in=20 > the rc script might deceive people, so I'd prefer keeping it as is.=20 > Anyway, I don't think that location does have to be changed in the=20 > average case, it might be a special requirement of you. Opinions from=20 > others are appreciated! >=20 Yes, I thought about that too. I wonder if command_args=3D"-p ${pidfile} > /dev/null 2>&1" would work? However I realize that my request is a special case and I should look=20 after it myself. Thanks for looking into it though (and thanks to Doug Barton for some=20 hints). Attached is my final result, for anyone else who is interested. --------------090309030200050503040801 Content-Type: text/plain; name="amavisd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="amavisd" #!/bin/sh # # PROVIDE: amavisd # REQUIRE: LOGIN # BEFORE: mail # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable amavisd: # #amavisd_enable="YES" # . /etc/rc.subr name=amavisd rcvar=${name}_enable command=/usr/local/sbin/amavisd required_files=/usr/local/etc/amavisd.conf load_rc_config $name # Set defaults : ${amavisd_enable="NO"} pidfile=${amavisd_pid-"/var/amavis/amavisd.pid"} command_args="> -p ${pidfile} /dev/null 2>&1" stop_postcmd=${name}_poststop amavisd_poststop() { rm -f $pidfile } run_rc_command "$1" --------------090309030200050503040801 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-Description: avast info --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0622-4, 02/06/2006 Tested on: 04/06/2006 3:15:46 PM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com --------------090309030200050503040801--