diff options
author | George Lebl <jirka@5z.com> | 2001-05-18 11:18:11 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2001-05-18 11:18:11 +0000 |
commit | 3058f3b2040f0b8071cba0bee3c1204f5e89fcaa (patch) | |
tree | 5ec8cbfdf58ace39d1bb69436210fd3a46ed610d | |
parent | 98280eb6bf01741c69b6e7836466cc59e8b1802e (diff) | |
download | gdm-3058f3b2040f0b8071cba0bee3c1204f5e89fcaa.tar.gz |
Add a config option for a failsafe X server which is emtpy by default
Fri May 18 04:17:00 2001 George Lebl <jirka@5z.com>
* daemon/gdm.[ch], daemon/slave.c, docs/C/gdm.sgml,
config/gdm.conf.in, gui/gdmconfig.(c|glade): Add a config
option for a failsafe X server which is emtpy by default
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | config/gdm.conf.in | 1 | ||||
-rw-r--r-- | daemon/gdm.c | 43 | ||||
-rw-r--r-- | daemon/gdm.h | 2 | ||||
-rw-r--r-- | daemon/slave.c | 8 | ||||
-rw-r--r-- | docs/C/gdm.sgml | 18 | ||||
-rw-r--r-- | gui/gdmconfig-strings.c | 4 | ||||
-rw-r--r-- | gui/gdmconfig.c | 3 | ||||
-rw-r--r-- | gui/gdmconfig.glade | 70 |
9 files changed, 140 insertions, 15 deletions
@@ -1,3 +1,9 @@ +Fri May 18 04:17:00 2001 George Lebl <jirka@5z.com> + + * daemon/gdm.[ch], daemon/slave.c, docs/C/gdm.sgml, + config/gdm.conf.in, gui/gdmconfig.(c|glade): Add a config + option for a failsafe X server which is emtpy by default + Fri May 18 00:16:58 2001 George Lebl <jirka@5z.com> * config/Makefile.am: don't overwrite gnomerc on install, that's bad diff --git a/config/gdm.conf.in b/config/gdm.conf.in index 4d035bcc..2eb658f5 100644 --- a/config/gdm.conf.in +++ b/config/gdm.conf.in @@ -14,6 +14,7 @@ LogDir=@EXPANDED_AUTHDIR@ PidFile=/var/run/gdm.pid PostSessionScriptDir=@EXPANDED_SYSCONFDIR@/gdm/PostSession/ PreSessionScriptDir=@EXPANDED_SYSCONFDIR@/gdm/PreSession/ +FailsafeXServer= XKeepsCrashing=@EXPANDED_SYSCONFDIR@/gdm/XKeepsCrashing XKeepsCrashingConfigurators=/usr/bin/X11/XF86Setup /usr/bin/X11/Xconfigurator RebootCommand=/sbin/shutdown -r now diff --git a/daemon/gdm.c b/daemon/gdm.c index d384a36a..3971f888 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -82,6 +82,7 @@ gchar *GdmDisplayInit = NULL; gchar *GdmSessionDir = NULL; gchar *GdmPreSession = NULL; gchar *GdmPostSession = NULL; +gchar *GdmFailsafeXServer = NULL; gchar *GdmXKeepsCrashing = NULL; gchar *GdmXKeepsCrashingConfigurators = NULL; gchar *GdmHalt = NULL; @@ -159,6 +160,7 @@ gdm_config_parse (void) GdmSessionDir = gnome_config_get_string (GDM_KEY_SESSDIR); GdmPreSession = gnome_config_get_string (GDM_KEY_PRESESS); GdmPostSession = gnome_config_get_string (GDM_KEY_POSTSESS); + GdmFailsafeXServer = gnome_config_get_string (GDM_KEY_FAILSAFE_XSERVER); GdmXKeepsCrashing = gnome_config_get_string (GDM_KEY_XKEEPSCRASHING); GdmXKeepsCrashingConfigurators = gnome_config_get_string (GDM_KEY_XKEEPSCRASHING_CONFIGURATORS); GdmConfigAvailable = gnome_config_get_bool (GDM_KEY_CONFIG_AVAILABLE); @@ -469,6 +471,26 @@ static gboolean deal_with_x_crashes (GdmDisplay *d) { gboolean just_abort = FALSE; + char *msg; + + if ( ! d->failsafe_xserver && + ! gdm_string_empty (GdmFailsafeXServer)) { + char *bin = g_strdup (GdmFailsafeXServer); + char *p = strchr (bin, argdelim); + if (p != NULL) + *p = '\0'; + /* Yay we have a failsafe */ + if (access (bin, X_OK) == 0) { + gdm_info (_("deal_with_x_crashes: Trying failsafe X " + "server %s"), GdmFailsafeXServer); + g_free (bin); + g_free (d->command); + d->command = g_strdup (GdmFailsafeXServer); + d->failsafe_xserver = TRUE; + return TRUE; + } + g_free (bin); + } /* Eeek X keeps crashing, let's try the XKeepsCrashing script */ if ( ! gdm_string_empty (GdmXKeepsCrashing) && @@ -492,6 +514,9 @@ deal_with_x_crashes (GdmDisplay *d) tempfd = mkstemp (tempname); close (tempfd); + gdm_info (_("deal_with_x_crashes: Running the " + "XKeepsCrashing script")); + pid = fork (); } else { tempfd = -1; @@ -588,15 +613,15 @@ deal_with_x_crashes (GdmDisplay *d) * it for them */ system (command); } - } else { - /* At this point .... screw the user, we don't know how to - * talk to him. He's on some 'l33t system anyway, so syslog - * reading will do him good */ - gchar *msg; - msg = g_strdup_printf (_("Failed to start X server several times in a short time period; disabling display %s"), d->name); - gdm_error (msg); - g_free (msg); - } + } /* else { + * At this point .... screw the user, we don't know how to + * talk to him. He's on some 'l33t system anyway, so syslog + * reading will do him good + * } */ + + msg = g_strdup_printf (_("Failed to start X server several times in a short time period; disabling display %s"), d->name); + gdm_error (msg); + g_free (msg); return FALSE; } diff --git a/daemon/gdm.h b/daemon/gdm.h index da0aa3e3..a9e1b5ff 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -108,6 +108,7 @@ #define GDM_KEY_PIDFILE "daemon/PidFile=/var/run/gdm.pid" #define GDM_KEY_POSTSESS "daemon/PostSessionScriptDir=" EXPANDED_SYSCONFDIR "/gdm/PostSession/" #define GDM_KEY_PRESESS "daemon/PreSessionScriptDir=" EXPANDED_SYSCONFDIR "/gdm/PreSession/" +#define GDM_KEY_FAILSAFE_XSERVER "daemon/FailsafeXServer=" #define GDM_KEY_XKEEPSCRASHING "daemon/XKeepsCrashing=" EXPANDED_SYSCONFDIR "/gdm/XKeepsCrashing" #define GDM_KEY_XKEEPSCRASHING_CONFIGURATORS "daemon/XKeepsCrashingConfigurators=/usr/bin/X11/XF86Setup /usr/bin/X11/Xconfigurator" #define GDM_KEY_REBOOT "daemon/RebootCommand=/sbin/shutdown -r now" @@ -203,6 +204,7 @@ struct _GdmDisplay { gchar *userauth; gboolean authfb; gchar *command; + gboolean failsafe_xserver; gchar *cookie; gchar *bcookie; gchar *name; diff --git a/daemon/slave.c b/daemon/slave.c index 6ec182d6..ebeb1abf 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -922,6 +922,14 @@ gdm_slave_greeter (void) gdm_unsetenv ("GDM_TIMED_LOGIN_OK"); } + if (d->failsafe_xserver) { + run_error_dialog (_("I could not start the regular X\n" + "server (your graphical environment)\n" + "and so this is a failsafe X server.\n" + "You should log in and properly\n" + "configure the X server.")); + } + argv = g_strsplit (GdmGreeter, argdelim, MAX_ARGS); execv (argv[0], argv); diff --git a/docs/C/gdm.sgml b/docs/C/gdm.sgml index 8a1fff76..6309bc65 100644 --- a/docs/C/gdm.sgml +++ b/docs/C/gdm.sgml @@ -578,6 +578,19 @@ </varlistentry> <varlistentry> + <term>FailsafeXServer</term> + <listitem> + <synopsis>FailsafeXServer=</synopsis> + <para> + An X command line in case we can't start the normal X server. + should probably be some sort of a script that runs an + appropriate low resolution server that will just work. + This is tried before the XKeepsCrashing script is run. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term>GnomeDefaultSession</term> <listitem> <synopsis>GnomeDefaultSession=share/gnome/default.session</synopsis> @@ -826,6 +839,11 @@ arguments are translated messages. Please see the standard installed script for further details. </para> + <para> + In case FailsafeXServer is setup, that will be tried first. + and this only used as a backup if even that server keeps + crashing. + </para> </listitem> </varlistentry> diff --git a/gui/gdmconfig-strings.c b/gui/gdmconfig-strings.c index 5158567b..b65f5e79 100644 --- a/gui/gdmconfig-strings.c +++ b/gui/gdmconfig-strings.c @@ -177,6 +177,10 @@ gchar *s = N_("Delete Server"); gchar *s = N_("Failsafe"); gchar *s = N_("Script to run when X is crashing: "); gchar *s = N_("X configurator binaries to try: "); +gchar *s = N_("A list of X setup programs to try for the above script, separated by spaces"); +gchar *s = N_("A script to run when the X server keeps crashing and the failsafe X server is either empty or also didn't take. This will run an X setup program defined below."); +gchar *s = N_("Failsafe X server:"); +gchar *s = N_("An X server binary to run if the standard one keeps crashing. If this fails the script below will be run."); gchar *s = N_("X-server setup"); gchar *s = N_("Session configuration"); gchar *s = N_("Session directory: "); diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c index da55fa3b..5c22768c 100644 --- a/gui/gdmconfig.c +++ b/gui/gdmconfig.c @@ -258,6 +258,7 @@ connect_binary_checks (void) "halt_command", "reboot_command", "background_program", + "failsafe_x_server", "x_keeps_crashing", NULL }; @@ -580,6 +581,7 @@ gdm_config_parse_most (gboolean factory) gdm_entry_set("session_dir", gnome_config_get_string (GDM_KEY_SESSDIR)); gdm_entry_set("pre_session_dir", gnome_config_get_string (GDM_KEY_PRESESS)); gdm_entry_set("post_session_dir", gnome_config_get_string (GDM_KEY_POSTSESS)); + gdm_entry_set("failsafe_x_server", gnome_config_get_string (GDM_KEY_FAILSAFE_XSERVER)); gdm_entry_set("x_keeps_crashing", gnome_config_get_string (GDM_KEY_XKEEPSCRASHING)); gdm_entry_set("x_keeps_crashing_configurators", gnome_config_get_string (GDM_KEY_XKEEPSCRASHING_CONFIGURATORS)); @@ -982,6 +984,7 @@ write_config (void) gdm_entry_write("session_dir", GDM_KEY_SESSDIR); gdm_entry_write("pre_session_dir", GDM_KEY_PRESESS); gdm_entry_write("post_session_dir", GDM_KEY_POSTSESS); + gdm_entry_write("failsafe_x_server", GDM_KEY_FAILSAFE_XSERVER); gdm_entry_write("x_keeps_crashing", GDM_KEY_XKEEPSCRASHING); gdm_entry_write("x_keeps_crashing_configurators", GDM_KEY_XKEEPSCRASHING_CONFIGURATORS); diff --git a/gui/gdmconfig.glade b/gui/gdmconfig.glade index a11ce061..81ccbd2d 100644 --- a/gui/gdmconfig.glade +++ b/gui/gdmconfig.glade @@ -3957,7 +3957,7 @@ tr_TR <class>GtkTable</class> <name>table51</name> <border_width>3</border_width> - <rows>2</rows> + <rows>3</rows> <columns>2</columns> <homogeneous>False</homogeneous> <row_spacing>3</row_spacing> @@ -3976,8 +3976,8 @@ tr_TR <child> <left_attach>0</left_attach> <right_attach>1</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> @@ -4002,8 +4002,8 @@ tr_TR <child> <left_attach>0</left_attach> <right_attach>1</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> @@ -4018,6 +4018,37 @@ tr_TR <widget> <class>GtkEntry</class> <name>x_keeps_crashing_configurators</name> + <tooltip>A list of X setup programs to try for the above script, separated by spaces</tooltip> + <can_focus>True</can_focus> + <signal> + <name>changed</name> + <handler>can_apply_now</handler> + <last_modification_time>Tue, 21 Mar 2000 21:36:52 GMT</last_modification_time> + </signal> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>x_keeps_crashing</name> + <tooltip>A script to run when the X server keeps crashing and the failsafe X server is either empty or also didn't take. This will run an X setup program defined below.</tooltip> <can_focus>True</can_focus> <signal> <name>changed</name> @@ -4045,8 +4076,35 @@ tr_TR </widget> <widget> + <class>GtkLabel</class> + <name>label255</name> + <label>Failsafe X server:</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> <class>GtkEntry</class> - <name>x_keeps_crashing</name> + <name>failsafe_x_server</name> + <tooltip>An X server binary to run if the standard one keeps crashing. If this fails the script below will be run.</tooltip> <can_focus>True</can_focus> <signal> <name>changed</name> |