aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authormezz <mezz@FreeBSD.org>2012-03-16 11:45:21 +0800
committermezz <mezz@FreeBSD.org>2012-03-16 11:45:21 +0800
commit16df0c33d3df4637d7ed0c42b807bfdf27289eac (patch)
tree1af628afa6da231baa93c8e6ef4872d431241241 /x11
parentf459243357eebd14ffb38104dbfffbf1ab47e666 (diff)
downloadfreebsd-ports-gnome-16df0c33d3df4637d7ed0c42b807bfdf27289eac.tar.gz
freebsd-ports-gnome-16df0c33d3df4637d7ed0c42b807bfdf27289eac.tar.zst
freebsd-ports-gnome-16df0c33d3df4637d7ed0c42b807bfdf27289eac.zip
Fix the rc.d script:
1. If gnome_enable is not set, gdm_enable will remain undefined. 2. Change the order of calling load_rc_config() and setting the default variables to the typical order for ports 3. Not only is the checkyesno for gdm_enable in gdm_start() not needed, it causes problems if, for example the user does '/usr/local/etc/rc.d/gdm onestart' from the command line. 4. Switch to using 'unlink' instead of 'rm -f' 5. If lshal does not exist, error out instead of looping 6. Mark a variable local Bump the PORTREVISION. PR: ports/159391 Submitted by: dougb Feature safe: yes
Diffstat (limited to 'x11')
-rw-r--r--x11/gdm/Makefile2
-rw-r--r--x11/gdm/files/gdm.in27
2 files changed, 17 insertions, 12 deletions
diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile
index fbf0415b2962..4a14618805e1 100644
--- a/x11/gdm/Makefile
+++ b/x11/gdm/Makefile
@@ -8,7 +8,7 @@
PORTNAME= gdm
PORTVERSION= 2.30.5
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
diff --git a/x11/gdm/files/gdm.in b/x11/gdm/files/gdm.in
index f7c4444b4d1f..bdc726d08d88 100644
--- a/x11/gdm/files/gdm.in
+++ b/x11/gdm/files/gdm.in
@@ -1,26 +1,30 @@
#!/bin/sh
+
# $FreeBSD$
# $MCom: ports-stable/x11/gdm/files/gdm.in,v 1.5 2010/07/21 13:50:46 kwm Exp $
-
+#
# PROVIDE: gdm
# REQUIRE: LOGIN cleanvar moused syscons dbus
#
# Add the following to /etc/rc.conf to start GDM at boot time:
#
# gdm_enable="YES"
-#
. /etc/rc.subr
. %%GNOME_SUBR%%
-gdm_enable=${gdm_enable-${gnome_enable}}
-gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
-gdm_lang=${gdm_lang-${LANG}}
-
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
name="gdm"
rcvar=gdm_enable
+
+load_rc_config ${name}
+
+gnome_enable=${gnome_enable:-NO}
+gdm_enable=${gdm_enable-${gnome_enable}}
+gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
+gdm_lang=${gdm_lang-${LANG}}
+
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/sbin/gdm-binary"
@@ -28,15 +32,14 @@ start_cmd="gdm_start"
gdm_start()
{
- if ! checkyesno gdm_enable ; then
- return 0
- fi
+ local iter
+
echo "Starting ${name}."
# make sure there is no pam configuration for gdm service in base system
if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
- rm -f /etc/pam.d/gdm
+ unlink /etc/pam.d/gdm
fi
( iter=0
@@ -49,6 +52,9 @@ gdm_start()
done
iter=0
while ! %%LOCALBASE%%/bin/lshal >/dev/null 2>&1 ; do
+ if [ ! -x %%LOCALBASE%%/bin/lshal ]; then
+ err 1 "%%LOCALBASE%%/bin/lshal is not installed"
+ fi
if [ ${iter} -eq 60 ]; then
break
fi
@@ -58,5 +64,4 @@ gdm_start()
LANG=${gdm_lang} ${command} ${gdm_flags} ) &
}
-load_rc_config ${name}
run_rc_command "$1"