From owner-freebsd-ports@FreeBSD.ORG Sun Jun 4 21:05:40 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 D6D5D16A75A for ; Sun, 4 Jun 2006 21:05:40 +0000 (UTC) (envelope-from gabor.kovesdan@t-hosting.hu) Received: from server.t-hosting.hu (server.t-hosting.hu [217.20.133.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C03B43D64 for ; Sun, 4 Jun 2006 21:05:33 +0000 (GMT) (envelope-from gabor.kovesdan@t-hosting.hu) Received: from localhost (localhost [127.0.0.1]) by server.t-hosting.hu (Postfix) with ESMTP id 9D72A999348; Sun, 4 Jun 2006 23:05:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at t-hosting.hu Received: from server.t-hosting.hu ([127.0.0.1]) by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cZl-daO-v8sg; Sun, 4 Jun 2006 23:05:23 +0200 (CEST) Received: from [192.168.2.186] (catv-50635cb6.catv.broadband.hu [80.99.92.182]) by server.t-hosting.hu (Postfix) with ESMTP id 2F3AE9990DC; Sun, 4 Jun 2006 23:05:23 +0200 (CEST) Message-ID: <44834B11.7050803@t-hosting.hu> Date: Sun, 04 Jun 2006 23:05:21 +0200 From: =?ISO-8859-1?Q?K=F6vesd=E1n_G=E1bor?= User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Paul Murphy References: <447F68B4.7050503@cogeco.ca> <44830D96.3060809@t-hosting.hu> <44833160.8040709@cogeco.ca> In-Reply-To: <44833160.8040709@cogeco.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 21:05:41 -0000 Paul Murphy wrote: > Kövesdán Gábor wrote: >> Paul Murphy wrote: >>> I need to keep the amavisd-new pid file in a location other than >>> the default (/var/amavis/amavisd.pid), so I have rewritten the >>> amavis rc script to include a knob for 'pidfile'. Please consider >>> the attached file for the amavisd-new port. >>> ------------------------------------------------------------------------ >>> >>> >>> #!/bin/sh >>> # >>> # $FreeBSD: ports/security/amavisd-new/files/amavisd.sh.in,v 1.3 >>> 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="YES" >>> # >>> >>> . /etc/rc.subr >>> >>> name=amavisd >>> rcvar=`set_rcvar` >>> >>> load_rc_config $name >>> >>> # Set defaults >>> : ${amavisd_enable:="NO"} >>> >>> pidfile=${amavisd_pid:-"/var/amavis/amavisd.pid"} >>> command=/usr/local/sbin/amavisd > /dev/null 2>&1 >>> required_files=/usr/local/etc/amavisd.conf >>> >>> stop_postcmd=stop_postcmd >>> >>> stop_postcmd() >>> { >>> rm -f $pidfile >>> } >>> >>> run_rc_command "$1" >>> >> I'd found this "new feature" a good idea first, but now, after a >> deeper look, I realized that we can't set the pid file with a >> command-line option, just in the config file. Thus, if we wanted to >> use an alternate location for a pid file, we would have to change it >> in two places: in amavisd.conf and in rc.conf. Accordingly, I think >> such modification in the rc script might deceive people, so I'd >> prefer keeping it as is. Anyway, I don't think that location does >> have to be changed in the average case, it might be a special >> requirement of you. Opinions from others are appreciated! >> > > Yes, I thought about that too. I wonder if > > command_args="-p ${pidfile} > /dev/null 2>&1" > > would work? > > However I realize that my request is a special case and I should look > after it myself. > > Thanks for looking into it though (and thanks to Doug Barton for some > hints). > > Attached is my final result, for anyone else who is interested. > ------------------------------------------------------------------------ > > #!/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" > > ------------------------------------------------------------------------ Where did you see that -p option? I got these options: [root@server /usr/ports]# amavisd --help amavisd-new-2.4.1 (20060508): Unknown argument. Usage: /usr/local/sbin/amavisd [-u user] [-g group] [-c config-file] ( [start] | stop | reload | debug | debug-sa | foreground ) But in case -p really works and overrides the settings in amavisd.conf, I have no objections against this modification. Gabor Kovesdan