[Mimedefang] redhat/* files not updated by configure?

James Ralston qralston+ml.mimedefang at andrew.cmu.edu
Wed Jul 16 20:12:00 EDT 2003


On 2003-07-14 at 08:34:08-0400 "David F. Skoll" <dfs at roaringpenguin.com> wrote:

> On Mon, 14 Jul 2003, James Ralston wrote:
> 
> > The files in the "redhat" subdirectory of the MIMEDefang
> > distribution aren't updated by running configure.
> 
> This is a "feature", because the Red Hat files are really valid only
> if you build an RPM without changing the locations of the spool and
> quarantine directories.
> 
> I'm mulling over pulling the redhat/ files completely, because Red
> Hat's init script system is ugly as sin, and the generic UNIX
> startup script works just fine on Red Hat (and all the other
> UNIX/Linux systems I have access to.)
> 
> However, if you provide a patch, I'll gladly apply it. :-)

I think it would be better to leave the Red Hat files in the
distribution, because it's far easier to coordinate enhancements and
fixes that way.  If you remove the files from the distribution, Red
Hat sysadmins are just going to fork hundreds of slightly-different
copies.

Anyway, the attached patch causes the Red Hat files to be generated by
configure, with appropriate variable substitutions.  After you apply
it, you need to run these two commands:

    $ mv redhat/mimedefang-init redhat/mimedefang-init.in
    $ mv redhat/mimedefang-sysconfig redhat/mimedefang-sysconfig.in

(These two "mv" commands reduced the size of the patch by almost an
order of magnitude.)

I've incorporated this patch into the MIMEDefang RPMs I build for Red
Hat Linux.  I've encountered no problems with redefining either the
spool directory or the quarantine directory.

Regards,
James
-------------- next part --------------
--- mimedefang-2.35/redhat/mimedefang-init.redhat	2003-07-01 17:33:50.000000000 -0400
+++ mimedefang-2.35/redhat/mimedefang-init	2003-07-16 18:53:10.000000000 -0400
@@ -7,9 +7,9 @@
 # Component   : redhat/mimedefang-init
 # Author      : Michael McLagan <Michael.McLagan at linux.org>
 # Creation    : 30-Apr-2002 13:42
-# Description : This is the init script for the RedHat RPM.  It lives 
-#               It lives in /etc/rc.d/init.d as mimedefang and is called
-#               by init during system startup.
+# Description : This is the init script for the RedHat RPM.  It lives
+#               in /etc/rc.d/init.d as mimedefang and is called by
+#               init during system startup.
 #
 #               Uses redhat/mimedefang-sysconfig (/etc/sysconfig/mimedefang)
 #               to set various variables used as parameters to start the 
@@ -110,8 +110,8 @@
 # description: mimedefang is a sendmail milter designed to perform virus \
 #              scans on incoming mail messages.
 # processname: mimedefang
-# config: /etc/mail/mimedefang-filter
-# pidfile: /var/spool/MIMEDefang/mimedefang.pid
+# config: @CONFDIR_EVAL@/mimedefang-filter
+# pidfile: @SPOOLDIR@/mimedefang.pid
 
 # Source function library.
 . /etc/rc.d/init.d/functions
@@ -143,8 +143,8 @@
 fi
 
 # Make sure reqired vars are set
-SOCKET=${SOCKET:=/var/spool/MIMEDefang/$prog.sock}
-MX_SOCKET=${MX_SOCKET:=/var/spool/MIMEDefang/$prog-multiplexor.sock}
+SOCKET=${SOCKET:=@SPOOLDIR@/$prog.sock}
+MX_SOCKET=${MX_SOCKET:=@SPOOLDIR@/$prog-multiplexor.sock}
 
 # Locale should be set to "C" for generating valid date headers
 LC_ALL=C
@@ -160,7 +160,7 @@
 
     echo -n "Starting $prog-multiplexor: "
     [ -e $MX_SOCKET ] && rm -f $MX_SOCKET
-    daemon $PROGDIR/$prog-multiplexor -p /var/spool/MIMEDefang/$prog-multiplexor.pid \
+    daemon $PROGDIR/$prog-multiplexor -p @SPOOLDIR@/$prog-multiplexor.pid \
 	$([ -n "$FILTER" ] && echo "-f $FILTER") \
 	$([ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY") \
 	$([ -n "$SUBFILTER" ] && echo "-F $SUBFILTER") \
@@ -194,7 +194,7 @@
 	ulimit -s 2048
     fi
 
-    daemon $PROGDIR/$prog -P /var/spool/MIMEDefang/$prog.pid \
+    daemon $PROGDIR/$prog -P @SPOOLDIR@/$prog.pid \
 	-m $MX_SOCKET \
 	$([ -n "$MX_USER" ] && echo "-U $MX_USER") \
 	$([ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY") \
@@ -212,8 +212,8 @@
     # Red Hat gets upset if pid files are not under /var/run, so let's
     # keep Red Hat happy...
     sleep 1
-    [ -f /var/spool/MIMEDefang/$prog.pid ] && cp -f /var/spool/MIMEDefang/$prog.pid /var/run
-    [ -f /var/spool/MIMEDefang/$prog-multiplexor.pid ] && cp -f /var/spool/MIMEDefang/$prog-multiplexor.pid /var/run
+    [ -f @SPOOLDIR@/$prog.pid ] && cp -f @SPOOLDIR@/$prog.pid /var/run
+    [ -f @SPOOLDIR@/$prog-multiplexor.pid ] && cp -f @SPOOLDIR@/$prog-multiplexor.pid /var/run
     return $RETVAL
 }
 
@@ -232,7 +232,7 @@
     echo
 
     [ -e $SOCKET ] && rm -f $SOCKET
-    [ -f /var/spool/MIMEDefang/$prog.pid ] && rm -f /var/spool/MIMEDefang/$prog.pid
+    [ -f @SPOOLDIR@/$prog.pid ] && rm -f @SPOOLDIR@/$prog.pid
     [ -f /var/run/$prog.pid ] && rm -f /var/run/$prog.pid
 
     # Stop daemon
@@ -241,7 +241,7 @@
     echo
 
     [ -e $MX_SOCKET ] && rm -f $MX_SOCKET
-    [ -f /var/spool/MIMEDefang/$prog-multiplexor.pid ] && rm -f /var/spool/MIMEDefang/$prog-multiplexor.pid
+    [ -f @SPOOLDIR@/$prog-multiplexor.pid ] && rm -f @SPOOLDIR@/$prog-multiplexor.pid
     [ -f /var/run/$prog-multiplexor.pid ] && rm -f /var/run/$prog-multiplexor.pid
 
     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
@@ -273,8 +273,8 @@
     RETVAL=$?
     ;;
     reread|reload)
-    if [ -r /var/spool/MIMEDefang/$prog-multiplexor.pid ] ; then
-	kill -INT `cat /var/spool/MIMEDefang/$prog-multiplexor.pid`
+    if [ -r @SPOOLDIR@/$prog-multiplexor.pid ] ; then
+	kill -INT `cat @SPOOLDIR@/$prog-multiplexor.pid`
 	RETVAL=$?
 	if [ $RETVAL = 0 ] ; then
 	    echo "Told $prog-multiplexor to force reread of filter rules."
--- mimedefang-2.35/redhat/mimedefang-sysconfig.redhat	2003-07-02 12:35:43.000000000 -0400
+++ mimedefang-2.35/redhat/mimedefang-sysconfig	2003-07-16 18:53:10.000000000 -0400
@@ -82,7 +82,7 @@
 ##########################################################################
 
 # The socket used by mimedefang to communicate with sendmail
-# SOCKET=/var/spool/MIMEDefang/mimedefang.sock
+# SOCKET=@SPOOLDIR@/mimedefang.sock
 
 # If you want to log messages like "Filter time is 156ms" to syslog,
 # uncomment the next line
@@ -134,7 +134,7 @@
 # MX_STATS_SYSLOG=no
 
 # The socket used by the multiplexor
-# MX_SOCKET=/var/spool/MIMEDefang/mimedefang-multiplexor.sock
+# MX_SOCKET=@SPOOLDIR@/mimedefang-multiplexor.sock
 
 # Maximum # of requests a process handles
 # MX_REQUESTS=200
@@ -177,7 +177,7 @@
 # MX_QUEUE_TIMEOUT=30
 
 # SUBFILTER specifies which filter rules file to use
-# SUBFILTER=/etc/mail/mimedefang-filter
+# SUBFILTER=@CONFDIR_EVAL@/mimedefang-filter
 
 # I question why I'm including this as I see no real need for it
 # but in the interests of a flexible implementation, here goes!
@@ -185,7 +185,7 @@
 # DO NOT CHANGE THIS VARIABLE LIGHTLY!!
 #
 # The filtering program used by mimedefang or the multiplexor. This is
-# *NOT* a replacement for /etc/mail/mimedefang-filter!!!  It replaces
+# *NOT* a replacement for @CONFDIR_EVAL@/mimedefang-filter!!!  It replaces
 # the entire mimedefang perl program, /usr/bin/mimedefang.pl and allows
 # a unique filtering agent to be used.  Read mimedefang-protocol man
 # page VERY carefully before you attempt to change this!
--- mimedefang-2.35/configure.in.redhat	2003-07-02 12:25:01.000000000 -0400
+++ mimedefang-2.35/configure.in	2003-07-16 18:53:10.000000000 -0400
@@ -596,7 +596,7 @@
 dnl evaluated versions of conf dir
 CONFDIR_EVAL=`echo ${sysconfdir}${CONFSUBDIR}`
 AC_SUBST(CONFDIR_EVAL)
-AC_OUTPUT(Makefile mimedefang.pl examples/init-script mimedefang-filter.5 mimedefang-multiplexor.8 mimedefang-protocol.7 mimedefang.8 mimedefang.pl.8 md-mx-ctrl.8 watch-mimedefang)
+AC_OUTPUT(Makefile mimedefang.pl examples/init-script mimedefang-filter.5 mimedefang-multiplexor.8 mimedefang-protocol.7 mimedefang.8 mimedefang.pl.8 md-mx-ctrl.8 watch-mimedefang redhat/mimedefang-init redhat/mimedefang-sysconfig)
 chmod a+x examples/init-script > /dev/null 2>&1
 chmod a+x watch-mimedefang > /dev/null 2>&1
 


More information about the MIMEDefang mailing list