Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Apr 2011 06:03:46 GMT
From:      Doug Barton <dougb@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/156594: x11/slim Take advantage of new get_pidfile_from_conf for rc.d script
Message-ID:  <201104230603.p3N63kmE096009@freefall.freebsd.org>
Resent-Message-ID: <201104230610.p3N6A5N0096378@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 23 06:10:04 UTC 2011
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104230603.p3N63kmE096009>