I wrote a startup script using rc.subr(8). Fix: patch follows: please remove files/milter-sid.sh
Responsible Changed From-To: freebsd-ports-bugs->dinoex Over to maintainer
At Tue, 10 Jan 2006 13:00:20 GMT, FreeBSD-gnats-submit@FreeBSD.org wrote: > http://www.freebsd.org/cgi/query-pr.cgi?pr=91596 > > >Category: ports > >Responsible: freebsd-ports-bugs > >Synopsis: [patch] mail/sid-milter startup script using rc.subr(8) > >Arrival-Date: Tue Jan 10 13:00:20 GMT 2006 a socket remains after stop command, and it prevents from starting again. this one should work okay. diff -Nru portstmp/mail/sid-milter/Makefile ports/mail/sid-milter/Makefile --- portstmp/mail/sid-milter/Makefile Sun Dec 11 18:40:35 2005 +++ ports/mail/sid-milter/Makefile Sat Jan 14 04:39:04 2006 @@ -7,6 +7,7 @@ PORTNAME= sid-milter PORTVERSION= 0.2.10 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= sid-milter @@ -14,6 +15,8 @@ MAINTAINER= dinoex@FreeBSD.org COMMENT= An sid and spf milter for Sendmail +USE_RC_SUBR= milter-sid.sh + .if !defined(SENDMAIL_MILTER_IN_BASE) .if defined(SENDMAIL_WITH_SHARED_MILTER) LIB_DEPENDS+= milter.3:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT} @@ -22,7 +25,7 @@ .endif .endif -RESTRICTED= may incorporate intellectual property, possible patent issues +RESTRICTED= "may incorporate intellectual property, possible patent issues" SENDMAIL_MILTER_PORT?= sendmail USE_REINPLACE= yes @@ -53,8 +56,6 @@ .endif pre-configure: - @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/milter-sid.sh \ - > ${WRKSRC}/milter-sid.sh ${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' \ -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS}|' \ -e "s|\`-O'|\`${CFLAGS}'|g" \ @@ -65,8 +66,6 @@ ${SITE} > ${WCONF}/site.config.m4 post-install: - ${INSTALL_SCRIPT} ${WRKSRC}/milter-sid.sh \ - ${PREFIX}/etc/rc.d/milter-sid.sh.sample .for i in ${MAN8} @${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8/ diff -Nru portstmp/mail/sid-milter/files/milter-sid.sh.in ports/mail/sid-milter/files/milter-sid.sh.in --- portstmp/mail/sid-milter/files/milter-sid.sh.in Thu Jan 1 09:00:00 1970 +++ ports/mail/sid-milter/files/milter-sid.sh.in Sat Jan 14 04:41:17 2006 @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: miltersid +# REQUIRE: DAEMON +# BEFORE: sendmail +# KEYWORD: shutdown + +# Define these miltersid_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/miltersid +# +# DO NOT CHdANGE THESE DEFAULT VALUES HERE +# +miltersid_enable=${miltersid_enable:-"NO"} +miltersid_socket=${miltersid_socket:-"local:/var/run/sid-filter"} +miltersid_pid=${miltersid_pid:-"/var/run/sid-filter.pid"} +miltersid_flags=${miltersid_flags:-"-r 0 -t"} + +. %%RC_SUBR%% + +name="miltersid" +pidfile=${miltersid_pid} +rcvar=`set_rcvar` +command="%%PREFIX%%/libexec/sid-filter" +command_args="-l -p ${miltersid_socket} -P ${miltersid_pid}" +stop_postcmd="sid_postcmd" + +load_rc_config $name + +sid_postcmd () +{ + if [ -S ${miltersid_socket##local:} ] ; then + rm -f ${miltersid_socket##local:} + elif [ -S ${miltersid_socket##unix:} ] ; then + rm -f ${miltersid_socket##unix:} + fi +} + +run_rc_command "$1" diff -Nru portstmp/mail/sid-milter/pkg-plist ports/mail/sid-milter/pkg-plist --- portstmp/mail/sid-milter/pkg-plist Tue May 24 00:55:24 2005 +++ ports/mail/sid-milter/pkg-plist Tue Jan 10 21:39:27 2006 @@ -1,4 +1,3 @@ -etc/rc.d/milter-sid.sh.sample libexec/sid-filter %%WITH_AR%%include/libar.h %%WITH_AR%%lib/libar.a
State Changed From-To: open->feedback [1] Can you verfify that the startup order is correct in all cases? [2] Your version seem to work only with the base sendmail, not with the sendmail from port. So I might rework this as an option. [3]
State Changed From-To: feedback->analyzed [3] The new rc script can start only one sid-milter. Not serious here, but some miltershave to run parrallel with diffrent configurations e.G. Virusscan with diffrent engines. Do you have some idea how a milter.rc script can be used for more than one instance.
State Changed From-To: analyzed->patched reply was made per email to me only. Feedback was included.
State Changed From-To: patched->closed committed, thanks.