Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 May 2012 23:22:30 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Andrej Zverev <az@FreeBSD.org>
Cc:        vsevolod@FreeBSD.org, cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/mail/rspamd Makefile ports/mail/rspamd/files rspamd.in
Message-ID:  <4FA618A6.7020504@FreeBSD.org>
In-Reply-To: <201205060601.q4661CaR030542@repoman.freebsd.org>
References:  <201205060601.q4661CaR030542@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030108010707090803030400
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

The attached patch fixes some problems with the 2 rc.d scripts for this
port:

1. Misc. style issues in both scripts
2. Neither script sets pidfile properly. The redirector script didn't
set pidfile= at all, which is a problem because that variable is magic
in rc.d.

hth,

Doug


On 05/05/2012 23:01, Andrej Zverev wrote:
> az          2012-05-06 06:01:12 UTC
> 
>   FreeBSD ports repository
> 
>   Modified files:
>     mail/rspamd          Makefile 
>     mail/rspamd/files    rspamd.in 
>   Log:
>   - rspamd needs group and user to be passed as args.
>     Currently this not true for checkconfig which called by restart,
>     reload, configtest.
>   - bump PORTREVISION
>   
>   PR:             ports/167220  http://www.FreeBSD.org/cgi/query-pr.cgi?pr=167220
>   Submitted by:   az
>   Approved by:    maintainer (timeout)
>   
>   Revision  Changes    Path
>   1.22      +1 -1      ports/mail/rspamd/Makefile
>   1.5       +2 -2      ports/mail/rspamd/files/rspamd.in
> 
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/mail/rspamd/Makefile.diff?&r1=1.21&r2=1.22&f=u
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/mail/rspamd/files/rspamd.in.diff?&r1=1.4&r2=1.5&f=u
> 


-- 

    This .signature sanitized for your protection

--------------030108010707090803030400
Content-Type: text/plain; charset=UTF-8;
 name="rspamd-rcd.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="rspamd-rcd.diff"

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/rspamd/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- Makefile	6 May 2012 06:01:12 -0000	1.22
+++ Makefile	6 May 2012 06:19:43 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	rspamd
 PORTVERSION=	0.4.6
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail
 MASTER_SITES=	http://highsecure.ru/
 
Index: files/rspamd.in
===================================================================
RCS file: /home/pcvs/ports/mail/rspamd/files/rspamd.in,v
retrieving revision 1.5
diff -u -r1.5 rspamd.in
--- files/rspamd.in	6 May 2012 06:01:12 -0000	1.5
+++ files/rspamd.in	6 May 2012 06:19:43 -0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#
+
 # $FreeBSD: ports/mail/rspamd/files/rspamd.in,v 1.5 2012/05/06 06:01:12 az Exp $
 #
 # PROVIDE: rspamd
@@ -21,40 +21,37 @@
 
 name=rspamd
 rcvar=rspamd_enable
-command=%%PREFIX%%/bin/rspamd
-restart_precmd="rspamd_checkconfig"
-reload_precmd="rspamd_checkconfig"
-configtest_cmd="rspamd_checkconfig"
-reopenlog_cmd="reopenlog_cmd"
-
-pidfile="$rspamd_pidfile"
-required_files=%%PREFIX%%/etc/rspamd.xml
 
 load_rc_config $name
 
-: ${rspamd_enable="NO"}
-: ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"}
+: ${rspamd_enable:="NO"}
 : ${rspamd_user="nobody"}
 : ${rspamd_group="nobody"}
 : ${rspamd_flags="-c %%PREFIX%%/etc/rspamd.xml"}
 
-stop_postcmd="rm -f $rspamd_pidfile"
+pidfile=${rspamd_pidfile:-"/var/run/rspamd/rspamd.pid"}
+
+command=%%PREFIX%%/bin/rspamd
+restart_precmd="rspamd_checkconfig"
+reload_precmd="rspamd_checkconfig"
+configtest_cmd="rspamd_checkconfig"
+reopenlog_cmd="reopenlog_cmd"
+
+required_files=%%PREFIX%%/etc/rspamd.xml
+command_args="-u ${rspamd_user} -g ${rspamd_group}"
+sig_reload="HUP"
+extra_commands="reload configtest reopenlog"
+stop_postcmd="rm -f $pidfile"
 
 rspamd_checkconfig()
 {
-        echo "Performing sanity check on rspamd configuration:"
-        eval ${command} ${command_args} -t
+	echo "Performing sanity check on rspamd configuration:"
+	eval ${command} ${command_args} -t
 }
 
 reopenlog_cmd()
 {
-   pkill -USR1 -F $rspamd_pidfile
+	pkill -USR1 -F $pidfile
 }
 
-sig_reload="HUP"
-
-command_args="-u ${rspamd_user} -g ${rspamd_group}"
-
-extra_commands="reload configtest reopenlog"
 run_rc_command "$1"
-
Index: files/rspamd_redirector.in
===================================================================
RCS file: /home/pcvs/ports/mail/rspamd/files/rspamd_redirector.in,v
retrieving revision 1.2
diff -u -r1.2 rspamd_redirector.in
--- files/rspamd_redirector.in	14 Jan 2012 08:56:03 -0000	1.2
+++ files/rspamd_redirector.in	6 May 2012 06:19:43 -0000
@@ -1,11 +1,10 @@
 #!/bin/sh
-#
+
 # $FreeBSD: ports/mail/rspamd/files/rspamd_redirector.in,v 1.2 2012/01/14 08:56:03 dougb Exp $
 #
 # PROVIDE: rspamd_redirector
 # REQUIRE: LOGIN
 # KEYWORD: shutdown
-
 #
 # Add the following line to /etc/rc.conf to enable rspamd_redirector:
 #
@@ -16,18 +15,17 @@
 
 name="rspamd_redirector"
 rcvar=rspamd_redirector_enable
-command="%%PREFIX%%/bin/rspamd-redirector"
 
 load_rc_config $name
 
-: ${rspamd_redirector_enable="NO"}
-: ${rspamd_redirector_pidfile="/var/run/rspamd/redirector.pid"}
+: ${rspamd_redirector_enable:="NO"}
 
-stop_postcmd="rm -f $rspamd_redirector_pidfile"
+pidfile=${rspamd_redirector_pidfile:-"/var/run/rspamd/redirector.pid"}
 
+command="%%PREFIX%%/bin/rspamd-redirector"
+command_interpreter="/usr/bin/perl"
 extra_commands="reload"
 sig_reload="USR1"
-
-command_interpreter="/usr/bin/perl"
+stop_postcmd="rm -f $pidfile"
 
 run_rc_command "$1"

--------------030108010707090803030400--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FA618A6.7020504>