Package: mailscanner
Version: 4.41.3-2
Severity: important
Tags: patch

Hi Mathias,

I take /etc/cron.d/mailscanner (and its equivalent upstream) to be a 
respawn mechanism: If the service ceases to function, the periodic respawn 
starts it up again.

The upstream init.d script and cron respawn script use a lockfile
Mailscanner.off, but this is missing in the Debian version.  

The lockfile enables the least surprise behaviour of when I (the admin)
stops the service, it stays stopped.  Or when I change to a runlevel in 
which the service is not stopped, it stays stopped.  And so on ...

Clearly I could abuse the $run_mailscanner /etc/default variable to
get this effect, but the default behaviour would still wrong.

I attach an (untested!) patch against 4.41.3-2 which attempts to simply 
reinstate this mechanism.

Please consider fixing this in future sarge point releases.

Regards,
Paddy

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages mailscanner depends on:
hi  debconf                       1.4.30.13  Debian configuration management sy
hi  libarchive-zip-perl           1.14-1     Module for manipulation of ZIP arc
hi  libcompress-zlib-perl         1.34-1     Perl module for creation and manip
hi  libconvert-binhex-perl        1.119-2    Perl5 module for extracting data f
hi  libconvert-tnef-perl          0.17-4     Perl module to read TNEF files
hi  libhtml-parser-perl           3.45-2     A collection of modules that parse
hi  libmime-perl                  5.417-1    Perl5 modules for MIME-compliant m
hi  libnet-cidr-perl              0.10-1     Manipulate IPv4/IPv6 netblocks in 
hi  perl                          5.8.4-8    Larry Wall's Practical Extraction 
hi  sendmail-bin [mail-transport- 8.13.4-3   powerful, efficient, and scalable 
ii  spamassassin                  3.0.3-2    Perl-based spam filter using text 
hi  ucf                           1.17       Update Configuration File: preserv
hi  unzip                         5.52-1     De-archiver for .zip files
hi  wget                          1.9.1-12   retrieves files from the web
diff -urN mailscanner-4.41.3/debian/cron.d mailscanner-4.41.3-0hs1/debian/cron.d
--- mailscanner-4.41.3/debian/cron.d    2005-07-20 19:25:32.611364026 +0100
+++ mailscanner-4.41.3-0hs1/debian/cron.d       2005-07-20 19:30:54.755422483 
+0100
@@ -9,4 +9,4 @@
 # them from stepping on each other's toes.  The worst that will
 # happen is that they will temporarily corrupt the database...
 
[EMAIL PROTECTED]       root    [ -f $LOCKFILE ] && exit 0; run_mailscanner=0; 
run_nice=0; if [ -f /etc/default/mailscanner ]; then . 
/etc/default/mailscanner; fi; [ $run_mailscanner = 0 ] && exit 0; trap "rm -f 
$LOCKFILE" EXIT; touch $LOCKFILE; /usr/bin/nice -$run_nice 
/usr/sbin/check_mailscanner >/dev/null 2>&1; exit 0
[EMAIL PROTECTED]       root    [ -f $LOCKFILE ] && exit 0; run_mailscanner=0; 
run_nice=0; if [ -f /etc/default/mailscanner ]; then . 
/etc/default/mailscanner; fi; [ $run_mailscanner = 0 ] && exit 0; [ -f 
/var/lock/subsys/MailScanner.off ] && exit 0; trap "rm -f $LOCKFILE" EXIT; 
touch $LOCKFILE; /usr/bin/nice -$run_nice /usr/sbin/check_mailscanner 
>/dev/null 2>&1; exit 0
diff -urN mailscanner-4.41.3/debian/init.d mailscanner-4.41.3-0hs1/debian/init.d
--- mailscanner-4.41.3/debian/init.d    2005-07-20 19:25:32.637361367 +0100
+++ mailscanner-4.41.3-0hs1/debian/init.d       2005-07-20 19:32:29.949687953 
+0100
@@ -90,6 +90,7 @@
        RETVAL=$?
        if [ $RETVAL -eq 0 ]; then
            rm -f /var/lock/subsys/mailscanner
+           touch /var/lock/subsys/MailScanner.off
        fi
        if ps axww | grep -i $DAEMON | grep -qv grep; then
            echo -n "(waiting"

Reply via email to