From dougb@FreeBSD.org  Sat Apr 23 06:03:47 2011
Return-Path: <dougb@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B7D71065670
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 23 Apr 2011 06:03:47 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id F0CC88FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 23 Apr 2011 06:03:46 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3N63kng096010
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 23 Apr 2011 06:03:46 GMT
	(envelope-from dougb@freefall.freebsd.org)
Received: (from dougb@localhost)
	by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3N63kmE096009;
	Sat, 23 Apr 2011 06:03:46 GMT
	(envelope-from dougb)
Message-Id: <201104230603.p3N63kmE096009@freefall.freebsd.org>
Date: Sat, 23 Apr 2011 06:03:46 GMT
From: Doug Barton <dougb@freebsd.org>
Reply-To: Doug Barton <dougb@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: x11/slim Take advantage of new get_pidfile_from_conf for rc.d script
X-Send-Pr-Version: 3.113
X-GNATS-Notify: henry.hu.sh@gmail.com

>Number:         156594
>Category:       ports
>Synopsis:       x11/slim Take advantage of new get_pidfile_from_conf for rc.d script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 23 06:10:04 UTC 2011
>Closed-Date:    Sun May 01 18:47:22 UTC 2011
>Last-Modified:  Sun May  1 18:50:04 UTC 2011
>Originator:     Doug Barton
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
AAAG
>Environment:
	DNA
>Description:
	/etc/rc.subr now has a function to find the pidfile from the
	conf file. This patch will use that function if it's present,
	and fall back to the old default if not.
>How-To-Repeat:

>Fix:
	Apply the following patch:

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/x11/slim/Makefile,v
retrieving revision 1.24
diff -u -r1.24 Makefile
--- Makefile	8 Jan 2011 08:05:29 -0000	1.24
+++ Makefile	23 Apr 2011 05:33:37 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	slim
 PORTVERSION=	1.3.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11
 MASTER_SITES=	${MASTER_SITE_BERLIOS} \
 		http://depot.fsck.ch/mirror/distfiles/
Index: files/slim.sh.in
===================================================================
RCS file: /home/pcvs/ports/x11/slim/files/slim.sh.in,v
retrieving revision 1.5
diff -u -r1.5 slim.sh.in
--- files/slim.sh.in	8 Jan 2011 08:05:29 -0000	1.5
+++ files/slim.sh.in	23 Apr 2011 05:33:37 -0000
@@ -30,12 +30,23 @@
 
 command=%%PREFIX%%/bin/slim
 command_args="-d"
-pidfile=/var/run/slim.pid
+
+find_pidfile()
+{
+	if type get_pidfile_from_conf >/dev/null 2>&1 &&
+	    get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then
+		pidfile="$_pidfile_from_conf"
+	else
+		pidfile="/var/run/${name}.pid"
+	fi
+}
 
 slim_rmfile ()
 {
 	local file
 
+	[ -z "$pidfile" ] && find_pidfile
+
 	for file in $pidfile /var/run/slim.auth; do
 		[ -e "$file" ] && unlink $file
 	done
@@ -47,6 +58,8 @@
 {
 	local xpid
 
+	find_pidfile
+
 	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
 	xpid="${xpid## }"
 	[ -n "$xpid" ] && kill ${xpid%% *}
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dougb 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Apr 23 06:10:14 UTC 2011 
Responsible-Changed-Why:  
Submitter has GNATS access (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156594 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Apr 23 06:10:19 UTC 2011 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: henry.hu.sh@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/156594: x11/slim Take advantage of new get_pidfile_from_conf for rc.d script
Date: Sat, 23 Apr 2011 06:10:17 UT

 Maintainer of x11/slim,
 
 Please note that PR ports/156594 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/156594
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Henry Hu <henry.hu.sh@gmail.com>
To: bug-followup@freebsd.org, dougb@freebsd.org
Cc:  
Subject: Re: ports/156594: x11/slim Take advantage of new get_pidfile_from_conf
 for rc.d script
Date: Sun, 1 May 2011 01:38:32 +0800

 --bcaec543079a84a2aa04a2264342
 Content-Type: text/plain; charset=ISO-8859-1
 
 Fine, please commit it.
 
 -- 
 Cheers,
 Henry
 
 --bcaec543079a84a2aa04a2264342
 Content-Type: text/html; charset=ISO-8859-1
 
 Fine, please commit it. <br clear="all"><br>-- <br>Cheers,<br>Henry<br>
 
 --bcaec543079a84a2aa04a2264342--
State-Changed-From-To: feedback->closed 
State-Changed-By: dougb 
State-Changed-When: Sun May 1 18:46:58 UTC 2011 
State-Changed-Why:  

Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/156594: commit references a PR
Date: Sun,  1 May 2011 18:46:48 +0000 (UTC)

 dougb       2011-05-01 18:46:39 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11/slim             Makefile 
     x11/slim/files       slim.sh.in 
   Log:
   Conditionally take advantage of the new get_pidfile_from_conf in rc.subr
   
   PR:             ports/156594
   Submitted by:   me
   Approved by:    maintainer
   
   Revision  Changes    Path
   1.25      +1 -1      ports/x11/slim/Makefile
   1.6       +15 -2     ports/x11/slim/files/slim.sh.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
