From 9dfd0c0cff62a78c56e9e74cad2aa3b985267dae Mon Sep 17 00:00:00 2001 From: Andrej Zverev Date: Tue, 15 May 2012 17:44:34 +0000 Subject: [PATCH] Fixes problems with the 2 rc.d scripts. Submitted by: dougb@ (via mail) Approved by: vsevolod@ (via mail) --- mail/rspamd/Makefile | 2 +- mail/rspamd/files/rspamd.in | 39 ++++++++++++-------------- mail/rspamd/files/rspamd_redirector.in | 14 ++++----- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 78703ab94455..1d27b8a8e168 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -7,7 +7,7 @@ PORTNAME= rspamd PORTVERSION= 0.4.6 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES= http://highsecure.ru/ diff --git a/mail/rspamd/files/rspamd.in b/mail/rspamd/files/rspamd.in index 225b49c041ca..b7ef42c472e7 100644 --- a/mail/rspamd/files/rspamd.in +++ b/mail/rspamd/files/rspamd.in @@ -1,5 +1,5 @@ #!/bin/sh -# + # $FreeBSD$ # # PROVIDE: rspamd @@ -21,40 +21,37 @@ name=rspamd rcvar=rspamd_enable + +load_rc_config $name + +: ${rspamd_enable:="NO"} +: ${rspamd_user="nobody"} +: ${rspamd_group="nobody"} +: ${rspamd_flags="-c %%PREFIX%%/etc/rspamd.xml"} + +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" -pidfile="$rspamd_pidfile" required_files=%%PREFIX%%/etc/rspamd.xml - -load_rc_config $name - -: ${rspamd_enable="NO"} -: ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"} -: ${rspamd_user="nobody"} -: ${rspamd_group="nobody"} -: ${rspamd_flags="-c %%PREFIX%%/etc/rspamd.xml"} - -stop_postcmd="rm -f $rspamd_pidfile" +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" - diff --git a/mail/rspamd/files/rspamd_redirector.in b/mail/rspamd/files/rspamd_redirector.in index 1b5c7456ed01..d3842b71ccd8 100644 --- a/mail/rspamd/files/rspamd_redirector.in +++ b/mail/rspamd/files/rspamd_redirector.in @@ -1,11 +1,10 @@ #!/bin/sh -# + # $FreeBSD$ # # 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"