ports/80633: mail/spamd: problems with rcNG (if spamd binary is already exists)

Anton Karpov toxa at toxahost.ru
Thu May 5 02:21:14 UTC 2005


>Number:         80633
>Category:       ports
>Synopsis:       mail/spamd: problems with rcNG (if spamd binary is already exists)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 05 02:20:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Anton Karpov
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD mercury.ank-pki.ru 5.4-STABLE FreeBSD 5.4-STABLE #0: Mon Apr 25 21:57:03 MSD 2005 root at mercury.ank-pki.ru:/usr/obj/usr/src/sys/MERCURY i386

>Description:

    I think, there is a little mess with rcNG. rc.subr uses 'ps -o "pid,command"' to determine if process
    is already running. But what if we have two ports which installs binaries with the same name?
    In this case, such ports are mail/p5-Mail-SpamAssassin and mail/spamd. Firstly, I've set up and start
    spamassassin:
    # ps wax|grep spamd                      
     2632  ??  I      0:00,01 spamd child (perl5.8.6)
     2635  ??  I      0:00,01 spamd child (perl5.8.6)
     2637  ??  I      0:00,01 spamd child (perl5.8.6)
     2640  ??  I      0:00,01 spamd child (perl5.8.6)
     2641  ??  I      0:00,01 spamd child (perl5.8.6)
    10219  ??  Is     0:00,77 /usr/local/bin/spamd -c -d -r /var/run/spamd.pid (perl5.8.6)

    After this, I've set up spamd, but it obviously refused to start from /usr/local/etc/rc.d/pfspamd.sh,
    because 'spamd' binary already exist in process list, even if it belongs to another package!

    [(6:01):/usr/local/etc/rc.d ] ./pfspamd.sh start
    pfspamd already running? (pid=2632 2635 2637 2640 2641).
    
   
   Yes, and if I stop /usr/local/etc/rc.d/sa-spamd.sh (spamassassin startup script) and start pfspamd.sh, 
   I will be unable to start sa-spamd.sh, and vice versa. This is because of 'spamd' process. Spamassassin 
   and spamd both execute process with such a name. And this makes rcNG sick.

>How-To-Repeat:

    See Description above
>Fix:

    The easiest way IMHO is to rename /usr/local/libexec/spamd to /usr/local/libexec/pfspamd
    The diff is attached

--- spamd.diff begins here ---
diff -ruN spamd.orig/Makefile spamd/Makefile
--- spamd.orig/Makefile	Thu May  5 05:39:30 2005
+++ spamd/Makefile	Thu May  5 05:43:31 2005
@@ -54,7 +54,8 @@
 .endif
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/spamd/spamd ${PREFIX}/libexec
+	${MV} ${WRKSRC}/spamd/spamd ${WRKSRC}/spamd/pfspamd
+	${INSTALL_PROGRAM} ${WRKSRC}/spamd/pfspamd ${PREFIX}/libexec
 	${INSTALL_PROGRAM} ${WRKSRC}/spamlogd/spamlogd ${PREFIX}/libexec
 	${INSTALL_PROGRAM} ${WRKSRC}/spamd-setup/spamd-setup ${PREFIX}/sbin
 	${INSTALL_PROGRAM} ${WRKSRC}/spamdb/spamdb ${PREFIX}/sbin
diff -ruN spamd.orig/files/pfspamd.sh spamd/files/pfspamd.sh
--- spamd.orig/files/pfspamd.sh	Thu May  5 05:39:30 2005
+++ spamd/files/pfspamd.sh	Thu May  5 05:40:08 2005
@@ -20,7 +20,7 @@
 name="pfspamd"
 rcvar=`set_rcvar`
 
-command="%%PREFIX%%/libexec/spamd"
+command="%%PREFIX%%/libexec/pfspamd"
 start_postcmd="pfspamd_postcmd"
 restart_postcmd="pfspamd_postcmd"
 
diff -ruN spamd.orig/pkg-plist spamd/pkg-plist
--- spamd.orig/pkg-plist	Thu May  5 05:39:30 2005
+++ spamd/pkg-plist	Thu May  5 05:41:22 2005
@@ -1,4 +1,4 @@
-libexec/spamd
+libexec/pfspamd
 libexec/spamlogd
 sbin/spamd-setup
 sbin/spamdb
--- spamd.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list