aboutsummaryrefslogtreecommitdiff
path: root/x11/kdebase4-workspace/files/kdm4.in
diff options
context:
space:
mode:
Diffstat (limited to 'x11/kdebase4-workspace/files/kdm4.in')
-rw-r--r--x11/kdebase4-workspace/files/kdm4.in39
1 files changed, 22 insertions, 17 deletions
diff --git a/x11/kdebase4-workspace/files/kdm4.in b/x11/kdebase4-workspace/files/kdm4.in
index c7d71dc4767f..483aacc1d4c2 100644
--- a/x11/kdebase4-workspace/files/kdm4.in
+++ b/x11/kdebase4-workspace/files/kdm4.in
@@ -3,7 +3,7 @@
# PROVIDE: kdm4
# REQUIRE: LOGIN cleanvar moused syscons dbus hald
#
-# Add the following to /etc/rc.conf to start kdm at boot time:
+# Add the following to /etc/rc.conf to start KDM at boot time:
#
# kdm4_enable="YES"
#
@@ -12,8 +12,6 @@
kdm4_enable=${kdm4_enable-"NO"}
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/kde4/bin:/usr/local/kde4/sbin
-
GENKDMCONF=%%PREFIX%%/bin/genkdmconf
KDMCONFDIR=%%PREFIX%%/share/config/kdm
@@ -21,33 +19,40 @@ name=kdm4
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/kdm-bin"
pidfile="/var/run/kdm.pid"
-procname="%%PREFIX%%/bin/kdm-bin"
start_cmd="kdm_start"
kdm_start()
{
- if ! checkyesno kdm4_enable ; then
- return 0
+ if ! checkyesno kdm4_enable; then
+ return 0
fi
echo "Starting ${name}."
- #Configure kdm if needed
+ # Configure KDM if needed.
if [ ! -r ${KDMCONFDIR}/kdmrc ]; then
- echo "Generating KDM configuration";
- ${GENKDMCONF} --no-old --in ${KDMCONFDIR};
+ echo "Generating KDM configuration."
+ ${GENKDMCONF} --no-old --in ${KDMCONFDIR}
else
- echo "Updating KDM configuration";
- ${GENKDMCONF} --in ${KDMCONFDIR};
+ echo "Updating KDM configuration."
+ ${GENKDMCONF} --in ${KDMCONFDIR}
fi
( iter=0
- while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
- if [ ${iter} -eq 60 ]; then
- break
- fi
- sleep 10
- iter=$(expr ${iter} + 1)
+ while ! pgrep -fq "^/usr/libexec/getty " > /dev/null 2>&1; do
+ if [ ${iter} -ge 600 ]; then
+ return 1
+ fi
+ sleep 1
+ iter=$(expr ${iter} + 1)
done
+ if checkyesno hald_enable; then
+ iter=0
+ while [ ${iter} -lt 60 ] &&
+ ! %%LOCALBASE%%/bin/lshal > /dev/null 2>&1; do
+ sleep 1
+ iter=$(expr ${iter} + 1)
+ done
+ fi
${command} ${kdm4_flags} ) &
}