From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 5 02:21:14 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64D7116A4CE for ; Thu, 5 May 2005 02:21:13 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09BCD43D72 for ; Thu, 5 May 2005 02:21:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j452K1eF097286 for ; Thu, 5 May 2005 02:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j452K134097285; Thu, 5 May 2005 02:20:01 GMT (envelope-from gnats) Resent-Date: Thu, 5 May 2005 02:20:01 GMT Resent-Message-Id: <200505050220.j452K134097285@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anton Karpov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3316816A4CE for ; Thu, 5 May 2005 02:10:24 +0000 (GMT) Received: from ank-pki.ru (mercury.ank-pki.ru [213.170.76.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08B1B43D58 for ; Thu, 5 May 2005 02:10:23 +0000 (GMT) (envelope-from root@ank-pki.ru) Received: (qmail 18747 invoked by uid 0); 5 May 2005 06:08:52 +0400 Message-Id: <20050505020852.18746.qmail@ank-pki.ru> Date: 5 May 2005 06:08:52 +0400 From: Anton Karpov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: delphij@FreeBSD.org Subject: ports/80633: mail/spamd: problems with rcNG (if spamd binary is already exists) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Anton Karpov List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 02:21:14 -0000 >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@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: