From root@coe.ufrj.br  Sat Feb  5 20:20:10 2005
Return-Path: <root@coe.ufrj.br>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A064116A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Feb 2005 20:20:10 +0000 (GMT)
Received: from coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1A12443D58
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Feb 2005 20:20:10 +0000 (GMT)
	(envelope-from root@coe.ufrj.br)
Received: from localhost (localhost [127.0.0.1])
	by coe.ufrj.br (Postfix) with ESMTP id 0678A17065
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Feb 2005 18:20:02 -0200 (BRST)
Received: from coe.ufrj.br ([146.164.53.65])
 by localhost (roma.coe.ufrj.br [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 01942-01 for <FreeBSD-gnats-submit@freebsd.org>;
 Sat,  5 Feb 2005 18:19:56 -0200 (BRST)
Received: by coe.ufrj.br (Postfix, from userid 0)
	id C94FA17063; Sat,  5 Feb 2005 18:10:51 -0200 (BRST)
Message-Id: <20050205201051.C94FA17063@coe.ufrj.br>
Date: Sat,  5 Feb 2005 18:10:51 -0200 (BRST)
From: Joao Carlos Mendes Luis <jonny@jonny.eng.br>
Reply-To: Joao Carlos Mendes Luis <jonny@jonny.eng.br>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: postgrey startup script bug
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         77149
>Category:       ports
>Synopsis:       postgrey startup script bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    vs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 05 20:20:14 GMT 2005
>Closed-Date:    Fri Apr 15 06:32:20 UTC 2005
>Last-Modified:  Fri Apr 15 06:32:20 UTC 2005
>Originator:     Joao Carlos Mendes Luis
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD roma.coe.ufrj.br 5.3-STABLE FreeBSD 5.3-STABLE #0: Fri Jan 21 19:03:05 BRST 2005 root@roma.coe.ufrj.br:/usr/cvsup/RELENG_5/src/sys/i386/compile/ROMA i386


>Description:

    The rc script does not find the real pid, and some functions do not behave
well, like stop or restart.

    See this command output example:

----8<--------8<--------8<--------8<--------8<--------8<--------8<----
# typeset -f psg
psg () 
{ 
    ps -ax | grep $1 | grep -v grep
}
# /usr/local/etc/rc.d/postgrey.sh start
Starting postgrey.
# psg perl
25098  ??  Ss     0:00.04 [perl5.8.6]
# /usr/local/etc/rc.d/postgrey.sh stop 
postgrey not running? (check /var/run/postgrey.pid).
# cat /var/run/postgrey.pid 
25098
# psg perl
25098  ??  Is     0:00.04 [perl5.8.6]
# 
----8<--------8<--------8<--------8<--------8<--------8<--------8<----

    I don't know why ps(8) does not show the script name, like other perl
scripts.  Maybe its a side effect of using Net::Server

>How-To-Repeat:
>Fix:


I could workaround the bug by putting the following lines in /etc/rc.conf:

----8<--------8<--------8<--------8<--------8<--------8<--------8<----
postgrey_enable="YES"
if [ "${pidfile}" = "${postgrey_pidfile}" ] ; then
  stop_cmd='test -f ${pidfile} && kill `cat ${pidfile} && rm ${pidfile}`'
  stop_postcmd=
  status_cmd='test -f ${pidfile} && if kill -0 `cat ${pidfile}` 2> /dev/null ; then echo "${name} is running." ; else echo "${name} is not running." ; return 1 ; fi'
fi
----8<--------8<--------8<--------8<--------8<--------8<--------8<----

    But a probable better fix is to adjust /etc/rc.subr or postgrey startup
script.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Wed Feb 9 15:38:14 GMT 2005 
State-Changed-Why:  
Forwarded PR to maintainer 


Responsible-Changed-From-To: freebsd-ports-bugs->vs 
Responsible-Changed-By: vs 
Responsible-Changed-When: Wed Feb 9 15:38:14 GMT 2005 
Responsible-Changed-Why:  
Handle 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77149 

From: "Volker Stolz" <vs@freebsd.org>
To: freebsd-gnats-submit@freebsd.org, jonny@jonny.eng.br,
	haroldp@internal.org
Cc:  
Subject: Re: ports/77149: postgrey startup script bug
Date: Wed, 09 Feb 2005 16:37:45 +0100

 Dear maintainer, is this the same issue as in ports/76253?
 
 Volker

From: =?UTF-8?B?Sm/Do28gQ2FybG9zIE1lbmRlcyBMdcOtcw==?= <jonny@jonny.eng.br>
To: Volker Stolz <vs@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org, haroldp@internal.org
Subject: Re: ports/77149: postgrey startup script bug
Date: Wed, 09 Feb 2005 13:55:07 -0200

 Volker Stolz wrote:
 > Dear maintainer, is this the same issue as in ports/76253?
 
      Note: "One problem is that the pidfile /var/run/postgrey.pid isn't 
 created."
 
      I don´t think so, because the pidfile is created on my setup.
 
 
 
 $ ps -aux | grep perl
 postgrey 18732  0.0  0.8  9968 8616  ??  Is   Sat09PM   0:03.88 [perl5.8.6]
 jonny    18238  0.0  0.1  1488  568  ph  R+    1:49PM   0:00.00 grep perl
 $ ls -l /var/run/postgrey.pid
 -rw-r--r--  1 postgrey  postgrey  6 Feb  5 21:30 /var/run/postgrey.pid
 $ cat /var/run/postgrey.pid
 18732
 $
 
 
      Other than that, it is very similar.
 
      Also: "This seems to only be a problem if you can't access 
 /dev/kmem" is wrong, because other perl files work perfectly, and I am 
 not using jail nor chroot in this setup.
 
      I think the problem is with the Net::Daemon perl library removing 
 the ARGV components, which is incompatible with rc.subr procedures. 
 Maybe the maintainer cannot do anything other than the same workaround 
 as I did, which is not Good(TM).
 
      Cheers,
 
 		Jonny

From: Harold Paulson <haroldp@internal.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc: will@csociety.org
Subject: Re: ports/77149: postgrey startup script bug
Date: Fri, 8 Apr 2005 10:37:12 -0700 (PDT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-1412422990-1112981832=:80500
 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
 
 The root problem here was that because of Postgrey's very long argument 
 list, FreeBSD 5.x was displaying, '[perl]' in ps instead of the full 
 application and args.
 
 The max length is dictated by kern.ps_arg_cache_limit and set to 256 by 
 default.
 
 The attached patch changes the defaults in the postgrey application from 
 /etc/ to ${PREFIX}/etc/, and trims down the argument list in the startup 
 script to use defaults for the whitelist locations.
 
  	- H
 
 
 --0-1412422990-1112981832=:80500
 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="postgrey-fix.patch"
 Content-Transfer-Encoding: BASE64
 Content-ID: <20050408103712.O80500@taurus.coyotecraft.com>
 Content-Description: Postgrey Fix
 Content-Disposition: attachment; filename="postgrey-fix.patch"
 
 ZGlmZiAtcnVOIHBvc3RncmV5LmJhay9NYWtlZmlsZSBwb3N0Z3JleS9NYWtl
 ZmlsZQ0KLS0tIHBvc3RncmV5LmJhay9NYWtlZmlsZQlTdW4gTWFyIDI3IDIx
 OjE5OjAxIDIwMDUNCisrKyBwb3N0Z3JleS9NYWtlZmlsZQlUaHUgQXByICA3
 IDE1OjUzOjQ4IDIwMDUNCkBAIC03LDYgKzcsNyBAQA0KIA0KIFBPUlROQU1F
 PQlwb3N0Z3JleQ0KIFBPUlRWRVJTSU9OPQkxLjE4DQorUE9SVFJFVklTSU9O
 PQkxDQogQ0FURUdPUklFUz0JbWFpbA0KIE1BU1RFUl9TSVRFUz0JaHR0cDov
 L2lzZy5lZS5ldGh6LmNoL3Rvb2xzL3Bvc3RncmV5L3B1Yi8NCiANCkBAIC0x
 OSw2ICsyMCw3IEBADQogDQogVVNFX1BFUkw1PQl5ZXMNCiBVU0VfUkNfU1VC
 Uj0JeWVzDQorVVNFX1JFSU5QTEFDRT0JeWVzDQogTk9fQlVJTEQ9CXllcw0K
 IA0KIEVUQ0ZJTEVTPQl3aGl0ZWxpc3R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z3JleSAtLWRiZGlyPS92YXIvZGIv
 cG9zdGdyZXkgXA0KLQktLXdoaXRlbGlzdC1jbGllbnRzPSUlUFJFRklYJSUv
 ZXRjL3Bvc3RmaXgvcG9zdGdyZXlfd2hpdGVsaXN0X2NsaWVudHMgXA0KLQkt
 LXdoaXRlbGlzdC1jbGllbnRzPSUlUFJFRklYJSUvZXRjL3Bvc3RmaXgvcG9z
 dGdyZXlfd2hpdGVsaXN0X2NsaWVudHMubG9jYWwgXA0KLQktLXdoaXRlbGlz
 dC1yZWNpcGllbnRzPSUlUFJFRklYJSUvZXRjL3Bvc3RmaXgvcG9zdGdyZXlf
 d2hpdGVsaXN0X3JlY2lwaWVudHMifQ0KKwktLWluZXQ9MTAwMjMgLWQgLS11
 c2VyPXBvc3RncmV5IC0tZ3JvdXA9cG9zdGdyZXkgLS1kYmRpcj0vdmFyL2Ri
 L3Bvc3RncmV5In0NCiANCiBwaWRmaWxlPSIke3Bvc3RncmV5X3BpZGZpbGV9
 Ig0KIA0K
 
 --0-1412422990-1112981832=:80500--

From: Harold Paulson <haroldp@internal.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/77149: postgrey startup script bug
Date: Tue, 12 Apr 2005 21:54:31 -0700 (PDT)

 Stupid mailer.  Here's that patch again, and a URL in case is fails again:
 
  	http://taurus.internal.org/~haroldp/postgrey-fix.patch
 
 Patch:
 
 
 diff -ruN postgrey.bak/Makefile postgrey/Makefile
 --- postgrey.bak/Makefile	Sun Mar 27 21:19:01 2005
 +++ postgrey/Makefile	Thu Apr  7 15:53:48 2005
 @@ -7,6 +7,7 @@
 
   PORTNAME=	postgrey
   PORTVERSION=	1.18
 +PORTREVISION=	1
   CATEGORIES=	mail
   MASTER_SITES=	http://isg.ee.ethz.ch/tools/postgrey/pub/
 
 @@ -19,6 +20,7 @@
 
   USE_PERL5=	yes
   USE_RC_SUBR=	yes
 +USE_REINPLACE=	yes
   NO_BUILD=	yes
 
   ETCFILES=	whitelist_clients whitelist_recipients
 @@ -51,6 +53,9 @@
   .if ${PERL_LEVEL} < 500600
   IGNORE=	Needs perl 5.6.1 or higher, install lang/perl5.8 and try again
   .endif
 +
 +post-patch:
 +	${REINPLACE_CMD} -e "s#/etc/#${PREFIX}/etc/#" ${WRKSRC}/postgrey
 
   pre-install:
   	${SED}	-e 's#%%PREFIX%%#${PREFIX}#g' -e 's#%%RC_SUBR%%#${RC_SUBR}#g' \
 diff -ruN postgrey.bak/files/postgrey.sh postgrey/files/postgrey.sh
 --- postgrey.bak/files/postgrey.sh	Wed Jan 26 16:03:28 2005
 +++ postgrey/files/postgrey.sh	Thu Apr  7 13:31:12 2005
 @@ -36,10 +36,7 @@
   postgrey_enable=${postgrey_enable:-"NO"}
   postgrey_pidfile=${postgrey_pidfile:-"/var/run/postgrey.pid"}
   postgrey_flags=${postgrey_flags:-"--pidfile=${postgrey_pidfile} \
 -	--inet=10023 -d --user=postgrey --group=postgrey --dbdir=/var/db/postgrey \
 -	--whitelist-clients=%%PREFIX%%/etc/postfix/postgrey_whitelist_clients \
 -	--whitelist-clients=%%PREFIX%%/etc/postfix/postgrey_whitelist_clients.local \
 -	--whitelist-recipients=%%PREFIX%%/etc/postfix/postgrey_whitelist_recipients"}
 +	--inet=10023 -d --user=postgrey --group=postgrey --dbdir=/var/db/postgrey"}
 
   pidfile="${postgrey_pidfile}"
 
State-Changed-From-To: feedback->closed 
State-Changed-By: dd 
State-Changed-When: Fri Apr 15 06:31:34 UTC 2005 
State-Changed-Why:  
Fixed in the upgrade to 1.21 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77149 
>Unformatted:
