summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2006-04-07 19:47:21 +0000
committerBrian Cameron <bcameron@src.gnome.org>2006-04-07 19:47:21 +0000
commitc84f5c4ddbe101c5ce4f404bc8c512d69ad34c56 (patch)
tree3441debc8825a69af8801bda8149f9a04382b77f
parentef6c41302d30e107f7bd521dd8000a57cd48d16f (diff)
downloadgdm-c84f5c4ddbe101c5ce4f404bc8c512d69ad34c56.tar.gz
Add new GdmXserverTimeout configuration variable so the length of time
2006-04-07 Brian Cameron <brian.cameron@sun.com> * config/gdm.conf.in, daemon/gdm.h, daemon/gdmconfig.c,s daemon/server.c: Add new GdmXserverTimeout configuration variable so the length of time that GDM waits for the Xserver to start can be tuned. This makes it easier to get GDM working with some Xservers (Xgl). Fixes bug #337670. Patch provided by Emilie (girlblossom@gmail.com).
-rw-r--r--ChangeLog9
-rw-r--r--config/gdm.conf.in4
-rw-r--r--daemon/gdm.h3
-rw-r--r--daemon/gdmconfig.c2
-rw-r--r--daemon/server.c13
5 files changed, 24 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f26c544..e9653628 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-04-07 Brian Cameron <brian.cameron@sun.com>
+
+ * config/gdm.conf.in, daemon/gdm.h, daemon/gdmconfig.c,s
+ daemon/server.c: Add new GdmXserverTimeout configuration
+ variable so the length of time that GDM waits for the
+ Xserver to start can be tuned. This makes it easier
+ to get GDM working with some Xservers (Xgl). Fixes
+ bug #337670. Patch provided by Emilie (girlblossom@gmail.com).
+
2006-04-05 Brian Cameron <brian.cameron@sun.com>
* .cvsignore, docs/es/.cvsignore, docs/uk/.cvsignore, gui/.cvsignore,
diff --git a/config/gdm.conf.in b/config/gdm.conf.in
index d304a8a8..de0ffcbb 100644
--- a/config/gdm.conf.in
+++ b/config/gdm.conf.in
@@ -192,6 +192,10 @@ Xnest=@X_XNEST_PATH@/Xnest @X_XNEST_CONFIG_OPTIONS@
# This determines whether GDM will send notifications to the console.
#ConsoleNotify=true
+# How long gdm should wait before it assumes a started Xserver is defunct and
+# kills it. 10 seconds should be long enough for X, but Xgl may need 20 or 25.
+GdmXserverTimeout=10
+
[security]
# Allow root to login. It makes sense to turn this off for kiosk use, when
# you want to minimize the possibility of break in.
diff --git a/daemon/gdm.h b/daemon/gdm.h
index 2c2e038b..82734a13 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -249,6 +249,9 @@ enum {
#define GDM_KEY_CONSOLE_CANNOT_HANDLE "daemon/ConsoleCannotHandle=am,ar,az,bn,el,fa,gu,hi,ja,ko,ml,mr,pa,ta,zh"
+/* How long to wait before assuming an Xserver has timed out */
+#define GDM_KEY_XSERVER_TIMEOUT "daemon/GdmXserverTimeout=10"
+
/* Per server definitions */
#define GDM_KEY_SERVER_PREFIX "server-"
#define GDM_KEY_SERVER_NAME "name=Standard server"
diff --git a/daemon/gdmconfig.c b/daemon/gdmconfig.c
index 645d230d..f268e343 100644
--- a/daemon/gdmconfig.c
+++ b/daemon/gdmconfig.c
@@ -151,6 +151,7 @@ static gint GdmRetryDelay = 0;
static gint GdmTimedLoginDelay = 0;
static gint GdmFlexibleXservers = 5;
static gint GdmFirstVt = 7;
+static gint GdmXserverTimeout = 10;
/* The SDTLOGIN feature is Solaris specific, and causes the Xserver to be
* run with user permissionsinstead of as root, which adds security but
@@ -533,6 +534,7 @@ gdm_config_init (void)
&GdmBackgroundProgramInitialDelay, &int_type);
gdm_config_add_hash (GDM_KEY_BACKGROUND_PROGRAM_RESTART_DELAY,
&GdmBackgroundProgramRestartDelay, &int_type);
+ gdm_config_add_hash (GDM_KEY_XSERVER_TIMEOUT, &GdmXserverTimeout, &int_type);
}
/**
diff --git a/daemon/server.c b/daemon/server.c
index cb11d839..4e17a6d0 100644
--- a/daemon/server.c
+++ b/daemon/server.c
@@ -49,8 +49,6 @@
#include "getvt.h"
#include "gdmconfig.h"
-#define SERVER_WAIT_ALARM 10
-
/* Local prototypes */
static void gdm_server_spawn (GdmDisplay *d, const char *vtarg);
static void gdm_server_usr1_handler (gint);
@@ -560,7 +558,7 @@ do_server_wait (GdmDisplay *d)
* just wait a few seconds and hope things just work,
* fortunately there is no such case yet and probably
* never will, but just for code anality's sake */
- gdm_sleep_no_signal (5);
+ gdm_sleep_no_signal (gdm_get_value_int(GDM_KEY_XSERVER_TIMEOUT));
} else if (d->server_uid != 0) {
int i;
@@ -580,7 +578,7 @@ do_server_wait (GdmDisplay *d)
for (i = 0;
d->dsp == NULL &&
d->servstat == SERVER_PENDING &&
- i < SERVER_WAIT_ALARM;
+ i < gdm_get_value_int(GDM_KEY_XSERVER_TIMEOUT);
i++) {
d->dsp = XOpenDisplay (d->name);
if (d->dsp == NULL)
@@ -602,8 +600,9 @@ do_server_wait (GdmDisplay *d)
fd_set rfds;
struct timeval tv;
- /* Wait up to SERVER_WAIT_ALARM seconds. */
- tv.tv_sec = MAX (1, SERVER_WAIT_ALARM - (time (NULL) - t));
+ /* Wait up to GDM_KEY_XSERVER_TIMEOUT seconds. */
+ tv.tv_sec = MAX (1, gdm_get_value_int(GDM_KEY_XSERVER_TIMEOUT)
+ - (time (NULL) - t));
tv.tv_usec = 0;
FD_ZERO (&rfds);
@@ -615,7 +614,7 @@ do_server_wait (GdmDisplay *d)
VE_IGNORE_EINTR (read (server_signal_pipe[0], buf, 4));
}
if ( ! server_signal_notified &&
- t + SERVER_WAIT_ALARM < time (NULL)) {
+ t + gdm_get_value_int(GDM_KEY_XSERVER_TIMEOUT) < time (NULL)) {
gdm_debug ("do_server_wait: Server timeout");
d->servstat = SERVER_TIMEOUT;
server_signal_notified = TRUE;