diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rwxr-xr-x | config/XKeepsCrashing | 12 | ||||
-rw-r--r-- | daemon/gdm.c | 5 | ||||
-rw-r--r-- | daemon/gdm.h | 2 | ||||
-rw-r--r-- | daemon/server.c | 26 | ||||
-rw-r--r-- | daemon/slave.c | 11 | ||||
-rw-r--r-- | utils/gdmopen.c | 5 |
7 files changed, 59 insertions, 19 deletions
@@ -1,3 +1,20 @@ +Thu Oct 25 01:49:57 2001 George Lebl <jirka@5z.com> + + * config/XKeepsCrashing: fix minor issues + + * daemon/gdm.c: set TEXTDOMAIN and TEXTDOMAINDIR for XKeepsCrashing + + * utils/gdmopen.c: echo \033(K onto the console to make sure + that non lat1 fonts get set up + + * daemon/gdm.h, daemon/server.c, daemon/slave.c: When starting + a server consider loss of connection within 5 seconds a crash + no matter what. It seems that for example not being able + to open a mouse manifests self AFTER server tells us + it's ready and we XOpenDisplay. Actually it's 5 seconds from + the USR1, which means 5 seconds after it's ready to accept + connections. + Wed Oct 24 17:57:03 2001 George Lebl <jirka@5z.com> * daemon/gdm.[ch], gui/gdmconfig.(c|glade), config/gdm.conf.in: diff --git a/config/XKeepsCrashing b/config/XKeepsCrashing index 68c013de..48fb85ba 100755 --- a/config/XKeepsCrashing +++ b/config/XKeepsCrashing @@ -1,9 +1,9 @@ #!/bin/sh -MSG3=`gettext -s _"I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. You will need to log in on a console and rerun the X configuration program. Then restart GDM."` +MSG3=`gettext -s "I cannot start the X server (your graphical interface). It is likely that it is not set up correctly. You will need to log in on a console and rerun the X configuration program. Then restart GDM."` MSG4=`gettext -s "Would you like me to try to run the X configuration program? Note that you will need the root password for this."` MSG5=`gettext -s "Please type in the root (privilaged user) password."` -MSG6=`gettest -s "I will now try to restart the X server again."` +MSG6=`gettext -s "I will now try to restart the X server again."` MSG7=`gettext -s "I will disable this X server for now. Restart GDM when it is configured correctly."` # there are some env vars defined: @@ -75,7 +75,7 @@ else exit $? fi -SETUP=`which $1` +SETUP=`which $XCONFIGURATOR` DIALOG=`which dialog` if test x$DIALOG = x ; then DIALOG=`which gdialog` @@ -100,7 +100,11 @@ if test x = x$SETUP -o x = x$DIALOG ; then echo echo ======================================================================= echo - echo "$MSG3" + if test -x /usr/bin/fmt ; then + echo "$MSG3" | /usr/bin/fmt + else + echo "$MSG3" + fi echo echo ======================================================================= read diff --git a/daemon/gdm.c b/daemon/gdm.c index 1c9f4212..4900fb36 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -721,10 +721,15 @@ deal_with_x_crashes (GdmDisplay *d) ve_unsetenv ("DISPLAY"); ve_unsetenv ("XAUTHORITY"); + /* some promised variables */ ve_setenv ("XLOG", xlog, TRUE); ve_setenv ("BINDIR", EXPANDED_BINDIR, TRUE); ve_setenv ("SBINDIR", EXPANDED_SBINDIR, TRUE); + /* To enable gettext stuff in the script */ + ve_setenv ("TEXTDOMAIN", PACKAGE, TRUE); + ve_setenv ("TEXTDOMAINDIR", GNOMELOCALEDIR, TRUE); + execv (argv[0], argv); /* yaikes! */ diff --git a/daemon/gdm.h b/daemon/gdm.h index 710af3b5..acdafa1e 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -24,6 +24,7 @@ #include <X11/Xmd.h> #include <X11/Xauth.h> #include <netinet/in.h> +#include <time.h> #define STX 0x2 /* Start of txt */ #define BEL 0x7 /* Bell, used to interrupt login for @@ -268,6 +269,7 @@ struct _GdmDisplay { guint8 dispstat; guint16 dispnum; guint8 servstat; + time_t starttime; guint8 type; pid_t greetpid; pid_t servpid; diff --git a/daemon/server.c b/daemon/server.c index 5164c60f..a729124b 100644 --- a/daemon/server.c +++ b/daemon/server.c @@ -31,6 +31,7 @@ #include <strings.h> #include <signal.h> #include <errno.h> +#include <time.h> #include <X11/Xlib.h> #include <vicious.h> @@ -534,13 +535,13 @@ void gdm_server_checklog (GdmDisplay *disp) { #ifdef __linux__ - if (d->vt < 0 && - (d->type == TYPE_LOCAL || - d->type == TYPE_FLEXI)) { - d->vt = display_vt (d); - if (d->vt >= 0) - gdm_slave_send_num (GDM_SOP_VT_NUM, d->vt); - } + if (d->vt < 0 && + (d->type == TYPE_LOCAL || + d->type == TYPE_FLEXI)) { + d->vt = display_vt (d); + if (d->vt >= 0) + gdm_slave_send_num (GDM_SOP_VT_NUM, d->vt); + } #endif } @@ -588,7 +589,7 @@ gdm_server_spawn (GdmDisplay *d) /* Close the XDMCP fd inherited by the daemon process */ if (GdmXdmcp) - gdm_xdmcp_close(); + gdm_xdmcp_close(); /* close things */ for (i = 0; i < sysconf (_SC_OPEN_MAX); i++) @@ -636,12 +637,12 @@ gdm_server_spawn (GdmDisplay *d) sigemptyset (&dfl_signal.sa_mask); if (sigaction (SIGHUP, &dfl_signal, NULL) < 0) { - gdm_error (_("gdm_server_spawn: Error setting HUP to SIG_DFL")); - _exit (SERVER_ABORT); + gdm_error (_("gdm_server_spawn: Error setting HUP to SIG_DFL")); + _exit (SERVER_ABORT); } if (sigaction (SIGTERM, &dfl_signal, NULL) < 0) { - gdm_error (_("gdm_server_spawn: Error setting TERM to SIG_DFL")); - _exit (SERVER_ABORT); + gdm_error (_("gdm_server_spawn: Error setting TERM to SIG_DFL")); + _exit (SERVER_ABORT); } /* unblock HUP/TERM/USR1 so that we can control the @@ -801,6 +802,7 @@ static void gdm_server_usr1_handler (gint sig) { d->servstat = SERVER_RUNNING; /* Server ready to accept connections */ + d->starttime = time (NULL); gdm_debug ("gdm_server_usr1_handler: Got SIGUSR1, server running"); diff --git a/daemon/slave.c b/daemon/slave.c index ef67d74a..7ff5c2db 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -42,6 +42,7 @@ #include <pwd.h> #include <grp.h> #include <errno.h> +#include <time.h> #include <syslog.h> #include <vicious.h> @@ -373,9 +374,9 @@ gdm_slave_run (GdmDisplay *display) /* X error handlers to avoid the default one (i.e. exit (1)) */ + do_xfailed_on_xio_error = TRUE; XSetErrorHandler (gdm_slave_xerror_handler); XSetIOErrorHandler (gdm_slave_xioerror_handler); - do_xfailed_on_xio_error = TRUE; /* We keep our own (windowless) connection (dsp) open to avoid the * X server resetting due to lack of active connections. */ @@ -2446,10 +2447,14 @@ gdm_slave_xioerror_handler (Display *disp) gdm_server_stop (d); gdm_verify_cleanup (d); - if (do_xfailed_on_xio_error) + if ((d->type == TYPE_LOCAL || + d->type == TYPE_FLEXI) && + (do_xfailed_on_xio_error || + d->starttime + 5 >= time (NULL))) { _exit (DISPLAY_XFAILED); - else + } else { _exit (DISPLAY_REMANAGE); + } } char * diff --git a/utils/gdmopen.c b/utils/gdmopen.c index 65a2b70c..00f91b2a 100644 --- a/utils/gdmopen.c +++ b/utils/gdmopen.c @@ -171,6 +171,11 @@ main (int argc, char *argv[]) /* wait to be really sure we have switched */ (void) ioctl(fd, VT_WAITACTIVE, vtno); +#ifdef __linux__ + /* Turn on fonts */ + write (0, "\033(K", 3); +#endif /* __linux__ */ + execvp (argv[1], &argv[1]); _exit (66); /* failed */ |