security/amavisd-new startup script

Kövesdán Gábor gabor.kovesdan at t-hosting.hu
Sun Jun 4 09:43:29 PDT 2006


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!

Regards,

Gabor Kovesdan


More information about the freebsd-ports mailing list