Do not blindly sleep but instead wait to ttys initialization before

starting.
This commit is contained in:
ajacoutot 2013-10-29 11:08:24 +00:00
parent a24c800720
commit 3b24322e3c
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.176 2013/10/26 09:12:20 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.177 2013/10/29 11:08:24 ajacoutot Exp $
# XXX configuring GDM from gnome-cc does not work
@ -8,7 +8,7 @@ COMMENT= GNOME display manager
GNOME_PROJECT= gdm
GNOME_VERSION= 3.10.0.1
REVISION= 0
REVISION= 1
SHARED_LIBS += gdm 0.0 # 1.0

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: gdm.rc,v 1.21 2013/09/28 16:22:40 ajacoutot Exp $
# $OpenBSD: gdm.rc,v 1.22 2013/10/29 11:08:24 ajacoutot Exp $
daemon="${TRUEPREFIX}/sbin/gdm"
@ -14,7 +14,14 @@ rc_pre() {
}
rc_start() {
${rcexec} "sleep 5; ${daemon} ${daemon_flags}" &
( i=0
while [ $i -le 10 ]; do
pgrep -qf "^/usr/libexec/getty " && break
sleep 1
i=`expr $i + 1`
done
[[ $i -gt 10 ]] && return 1
${rcexec} "${daemon} ${daemon_flags}" ) &
}
rc_stop() {