ports/159391: x11/gdm needs hal dep, rc.d fixes
Doug Barton
dougb at FreeBSD.org
Tue Aug 2 19:20:10 UTC 2011
>Number: 159391
>Category: ports
>Synopsis: x11/gdm needs hal dep, rc.d fixes
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Aug 02 19:20:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Doug Barton
>Release: FreeBSD 8.2-STABLE i386
>Organization:
AAAG
>Environment:
DNA
>Description:
The rc.d script calls lshal which is provided by hal, so the
port needs to have that dependency. (Noticed when installing
gdm as part of xfce4.)
The rc.d script itself has some problems, which are addressed
in the following patch:
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
>How-To-Repeat:
DNA
>Fix:
Apply the following patch:
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/x11/gdm/Makefile,v
retrieving revision 1.138
diff -u -r1.138 Makefile
--- Makefile 25 Jun 2011 14:52:18 -0000 1.138
+++ Makefile 2 Aug 2011 19:10:56 -0000
@@ -8,7 +8,7 @@
PORTNAME= gdm
PORTVERSION= 2.30.5
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
Index: files/gdm.in
===================================================================
RCS file: /home/pcvs/ports/x11/gdm/files/gdm.in,v
retrieving revision 1.20
diff -u -r1.20 gdm.in
--- files/gdm.in 25 Jul 2010 19:35:05 -0000 1.20
+++ files/gdm.in 2 Aug 2011 19:10:56 -0000
@@ -1,26 +1,30 @@
#!/bin/sh
+
# $FreeBSD: ports/x11/gdm/files/gdm.in,v 1.20 2010/07/25 19:35:05 kwm Exp $
# $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=`set_rcvar`
+
+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 @@
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 @@
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 @@
LANG=${gdm_lang} ${command} ${gdm_flags} ) &
}
-load_rc_config ${name}
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list