Date: Sat, 5 Feb 2005 18:10:51 -0200 (BRST) From: Joao Carlos Mendes Luis <jonny@jonny.eng.br> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/77149: postgrey startup script bug Message-ID: <20050205201051.C94FA17063@coe.ufrj.br> Resent-Message-ID: <200502052020.j15KKFR8024444@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 77149 >Category: ports >Synopsis: postgrey startup script bug >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 05 20:20:14 GMT 2005 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050205201051.C94FA17063>