pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/pkgsrc-2007Q1]: pkgsrc/mail/clamsmtp Pullup ticket 2103 - requested b...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d8659d1a92f5
branches: pkgsrc-2007Q1
changeset: 527407:d8659d1a92f5
user: salo <salo%pkgsrc.org@localhost>
date: Thu May 31 14:22:21 2007 +0000
description:
Pullup ticket 2103 - requested by martti
rc.d script fix for clamsmtp
Revisions pulled up:
- pkgsrc/mail/clamsmtp/Makefile 1.30
- pkgsrc/mail/clamsmtp/files/clamsmtpd.sh 1.6
Module Name: pkgsrc
Committed By: martti
Date: Wed May 30 06:07:08 UTC 2007
Modified Files:
pkgsrc/mail/clamsmtp: Makefile
pkgsrc/mail/clamsmtp/files: clamsmtpd.sh
Log Message:
Updated mail/clamsmtp to 1.8nb1
* Make sure clamd is really running before starting clamsmtpd (pkg/36292)
diffstat:
mail/clamsmtp/Makefile | 3 ++-
mail/clamsmtp/files/clamsmtpd.sh | 30 ++++++++++++++++++++++++++----
2 files changed, 28 insertions(+), 5 deletions(-)
diffs (80 lines):
diff -r 094e0a36f147 -r d8659d1a92f5 mail/clamsmtp/Makefile
--- a/mail/clamsmtp/Makefile Thu May 31 13:58:16 2007 +0000
+++ b/mail/clamsmtp/Makefile Thu May 31 14:22:21 2007 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.26 2006/10/27 17:37:18 xtraeme Exp $
+# $NetBSD: Makefile,v 1.26.4.1 2007/05/31 14:22:21 salo Exp $
DISTNAME= clamsmtp-1.8
+PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://memberwebs.com/nielsen/software/clamsmtp/
diff -r 094e0a36f147 -r d8659d1a92f5 mail/clamsmtp/files/clamsmtpd.sh
--- a/mail/clamsmtp/files/clamsmtpd.sh Thu May 31 13:58:16 2007 +0000
+++ b/mail/clamsmtp/files/clamsmtpd.sh Thu May 31 14:22:21 2007 +0000
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: clamsmtpd.sh,v 1.5 2005/10/08 08:56:48 xtraeme Exp $
+# $NetBSD: clamsmtpd.sh,v 1.5.12.1 2007/05/31 14:22:21 salo Exp $
#
# PROVIDE: clamsmtpd
# REQUIRE: LOGIN clamd
@@ -23,7 +23,7 @@
fi
name="clamsmtpd"
-rcvar=$name
+rcvar="${name}"
command="@PREFIX@/sbin/${name}"
pidfile="@VARBASE@/run/clamsmtpd.pid"
@@ -39,11 +39,33 @@
/^#/ {next}; /^User[ ]/ {r = $2};
END {print r}' ${clamav_conffile}`}
else
+ : ${socket="/tmp/clamd"}
: ${clamsmtpd_user="@CLAMAV_USER@"}
fi
clamsmtpd_prestart()
{
+ if [ ! -S "${socket}" ]; then
+ # Max wait time is 2 minutes
+ retries=11
+
+ @ECHO@ -n "Waiting for clamd to become ready"
+ while [ ${retries} -gt 0 -a ! -S "${socket}" ]; do
+ @ECHO@ -n "."
+ sleep 10
+ retries=$((retries - 1))
+ done
+ if [ ! -S "${socket}" ]; then
+ @ECHO@ ""
+ @ECHO@ "ERROR: Unable to start clamsmtpd as clamd is not running!"
+ exit 1
+ fi
+
+ # Wait another 10 seconds so that clamd is really ready
+ @ECHO@ -n "."
+ sleep 10
+ @ECHO@ ""
+ fi
@TOUCH@ ${pidfile}
@CHOWN@ ${clamsmtpd_user} ${pidfile}
}
@@ -52,11 +74,11 @@
{
@ECHO@ "Starting ${name}."
doit="${command} ${clamsmtpd_flags} -p ${pidfile}"
- @SU@ -m ${clamsmtpd_user} -c "$doit"
+ @SU@ -m ${clamsmtpd_user} -c "${doit}"
}
if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
- load_rc_config $name
+ load_rc_config ${name}
run_rc_command "$1"
else
if [ -f /etc/rc.conf ]; then
Home |
Main Index |
Thread Index |
Old Index