From oss@technorama.net  Tue Jan  4 22:17:58 2005
Return-Path: <oss@technorama.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 117AE16A4E2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Jan 2005 22:17:58 +0000 (GMT)
Received: from technorama.net (technorama.net [216.254.100.121])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 77E9F43D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Jan 2005 22:17:57 +0000 (GMT)
	(envelope-from oss@technorama.net)
Received: (qmail 6602 invoked by uid 1061); 4 Jan 2005 22:17:56 -0000
Message-Id: <20050104221756.6601.qmail@technorama.net>
Date: 4 Jan 2005 22:17:56 -0000
From: <oss-freebsd-ports@technorama.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] net/jabberd: rc.d/jabberd.sh
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75824
>Category:       ports
>Synopsis:       [patch] net/jabberd: rc.d/jabberd.sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 04 22:20:28 GMT 2005
>Closed-Date:    Tue Feb 01 11:12:31 GMT 2005
>Last-Modified:  Tue Feb 01 11:12:31 GMT 2005
>Originator:     
>Release:        FreeBSD 5.2.1-RELEASE-p13 i386
>Organization:
>Environment:
System: FreeBSD technorama.net 5.2.1-RELEASE-p13 FreeBSD 5.2.1-RELEASE-p13 #1: Tue Jan 4 14:56:57 EST 2005 root@technorama.net:/usr/src/sys/i386/compile/TECHNORAMA i386


>Description:

	After a crash jabberd refuses to run if a pidfile exists.
	The patch below checks if a process with the pid contained
	in jabber.pid is running and removes the file if not.

>How-To-Repeat:

	# [machine crashes, jabberd dies, `killall jabberd`]
	/usr/local/etc/rc.d/jabberd.sh start
	# jabberd fails to start

>Fix:

-- /usr/local/etc/rc.d/jabberd.sh.orig      Thu Oct  7 11:54:28 2004
+++ /usr/local/etc/rc.d/jabberd.sh  Tue Jan  4 16:04:59 2005
@@ -19,8 +19,19 @@

 case ${1:-start} in
 start)
-    su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml" ;;
+    if [ -f jabber.pid ]; then
+        pid=`cat jabber.pid`
+        if [ ! -z "$pid" ] && kill -0 -- "$pid"; then
+            echo "A pidfile already exists at the specified location."
+            echo "Check to ensure another copy of the server is not running, or remove the existing file."
+            exit 1
+        fi

+        rm -f ${RUNDIR}/jabber.pid;
+    fi
+
+    su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml"
+    ;;
 stop)
     killall -SIGKILL -u ${USER} jabberd;
     rm -f ${RUNDIR}/jabber.pid;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Fri Jan 7 12:03:44 GMT 2005 
State-Changed-Why:  
Forwarded PR to maintainer; tweaked synopsis 

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

From: "Volker Stolz" <vs@freebsd.org>
To: freebsd-gnats-submit@freebsd.org,
	oss-freebsd-ports@technorama.net, kirk@strauser.com
Cc:  
Subject: Re: ports/75824: [patch] rc.d/jabberd.sh
Date: Fri, 07 Jan 2005 13:04:24 +0100

 Dear maintainer, please review the proposed patch!
 
 Volker

From: Kirk Strauser <kirk@strauser.com>
To: "Volker Stolz" <vs@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org,
	oss-freebsd-ports@technorama.net
Subject: Re: ports/75824: [patch] rc.d/jabberd.sh
Date: Fri, 7 Jan 2005 10:08:29 -0600

 --nextPart2590941.RWzk3jVndt
 Content-Type: text/plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Friday 07 January 2005 06:04, Volker Stolz wrote:
 
 > Dear maintainer, please review the proposed patch!
 
 There are a couple of problems with the patch (and my interaction with it):
 
 1) The PR was submitted against net/jabberd (of which I am the maintainer),=
 =20
 the the patch is actually against net/jabber (of which I am not).
 
 2) Would this be an appropriate time to switch that file to use rc.subr,=20
 rather than continuing to patch the old version?
 
 It otherwise looks as though it would work as expected.
 =2D-=20
 Kirk Strauser
 
 --nextPart2590941.RWzk3jVndt
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 
 iD8DBQBB3rQB5sRg+Y0CpvERAo7mAKCFZtnY5z3xR6gtpbujUAvWwcnQoACbBsgY
 JdIWH0Smt4XYogpK7hp+X0k=
 =3lnY
 -----END PGP SIGNATURE-----
 
 --nextPart2590941.RWzk3jVndt--
State-Changed-From-To: feedback->closed 
State-Changed-By: vs 
State-Changed-When: Tue Feb 1 11:11:14 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

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