aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2011-01-08 16:05:29 +0800
committerdougb <dougb@FreeBSD.org>2011-01-08 16:05:29 +0800
commit5169f4895a99e69fd7c164ff54c4f8d7de84dbef (patch)
tree899888d292a473e344e0a39b3deb98a06e295b7a /x11
parent2bed800482c4af846d28f769aaad89ead7ef3aa5 (diff)
downloadfreebsd-ports-5169f4895a99e69fd7c164ff54c4f8d7de84dbef.tar.gz
freebsd-ports-5169f4895a99e69fd7c164ff54c4f8d7de84dbef.tar.zst
freebsd-ports-5169f4895a99e69fd7c164ff54c4f8d7de84dbef.zip
Update rc.d script to effectively stop slim
Maintainer assisted with testing various versions of the script. This final version seems to have addressed all of the issues that he and I saw. PR: ports/153392 Submitted by: me
Diffstat (limited to 'x11')
-rw-r--r--x11/slim/Makefile1
-rw-r--r--x11/slim/files/slim.sh.in30
2 files changed, 29 insertions, 2 deletions
diff --git a/x11/slim/Makefile b/x11/slim/Makefile
index 2f70d05fb8a2..74611d633fa4 100644
--- a/x11/slim/Makefile
+++ b/x11/slim/Makefile
@@ -7,6 +7,7 @@
PORTNAME= slim
PORTVERSION= 1.3.2
+PORTREVISION= 1
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_BERLIOS} \
http://depot.fsck.ch/mirror/distfiles/
diff --git a/x11/slim/files/slim.sh.in b/x11/slim/files/slim.sh.in
index c9be5decc4ee..642cfacd0045 100644
--- a/x11/slim/files/slim.sh.in
+++ b/x11/slim/files/slim.sh.in
@@ -1,9 +1,11 @@
#!/bin/sh
+# $FreeBSD$
+#
# PROVIDE: slim
# REQUIRE: LOGIN
+# KEYWORD: shutdown
-#
# Add the following lines to /etc/rc.conf to enable slim:
# slim_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable slim
@@ -11,13 +13,17 @@
# Alternatively, edit /etc/ttys and change the line below
# ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure
# to this:
-# ttyv8 "/usr/local/bin/slim" xterm on secure
+# ttyv8 "%%PREFIX%%/bin/slim" xterm on secure
. /etc/rc.subr
name="slim"
rcvar=`set_rcvar`
+start_precmd=${name}_rmfile
+stop_precmd=${name}_prestop
+stop_postcmd=${name}_rmfile
+
load_rc_config $name
: ${slim_enable="NO"}
@@ -26,4 +32,24 @@ command=%%PREFIX%%/bin/slim
command_args="-d"
pidfile=/var/run/slim.pid
+slim_rmfile ()
+{
+ local file
+
+ for file in $pidfile /var/run/slim.auth; do
+ [ -e "$file" ] && unlink $file
+ done
+
+ return 0
+}
+
+slim_prestop ()
+{
+ local xpid
+
+ xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
+ xpid="${xpid## }"
+ [ -n "$xpid" ] && kill ${xpid%% *}
+}
+
run_rc_command "$1"