aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
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"