SHA256
1
0
forked from pool/gdm
gdm/gdm-switch-to-tty1.patch
Dominique Leuenberger f4387cc926 Accepting request 1073111 from GNOME:Next
Subbing RC in case upstream forget to do a stable bump
- Update to version 44.rc:
  + Lots of code clean ups.
  + Fix detection of virt on efi setups.
  + Fix btmp accounting on failed logins.
  + Ensure pam_close_session is called even if worker is killed.
  + Updated translations.
- Drop gdm-switch-user-tty7.patch: fixed upstream.
- Refresh patches with Quilt.
- Rebase gdm-xauthlocalhostname.patch due to code clean up commit:
  88d79fe24cda8623a4b460c0aa9628178c26f745.

OBS-URL: https://build.opensuse.org/request/show/1073111
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=515
2023-03-20 12:50:07 +00:00

67 lines
1.5 KiB
Diff

--- a/daemon/main.c
+++ b/daemon/main.c
@@ -61,6 +61,31 @@ static GdmSettings *settings =
static uid_t gdm_uid = -1;
static gid_t gdm_gid = -1;
+#define SHELLSCRIPT "\
+/bin/bash -c \
+\'PROCESS=\"X Xwayland plymouth\"\;\
+R=$(pidof $PROCESS)\;\
+while [ $? == 0 ]\;\
+do sleep 1\;\
+ R=$(pidof $PROCESS)\;\
+done\;\
+systemd-cat echo Switch to tty1 Successfully\;\
+/usr/bin/chvt 1\'\
+"
+
+static void
+jump_to_tty1 ()
+{
+ g_autoptr(GError) error = NULL;
+
+ g_debug ("Spawn jump to tty1 process");
+ g_spawn_command_line_async (SHELLSCRIPT,
+ &error);
+
+ if (error != NULL)
+ g_warning ("Error chvt to tty1: %s", error->message);
+}
+
static gboolean
timed_exit_cb (GMainLoop *loop)
{
@@ -263,6 +288,12 @@ on_shutdown_signal_cb (gpointer user_dat
return FALSE;
}
+static void
+on_signal_term_cb ()
+{
+ g_debug ("Received SIGTERM again");
+}
+
static gboolean
on_sighup_cb (gpointer user_data)
{
@@ -387,6 +418,7 @@ main (int argc,
g_main_loop_run (main_loop);
g_debug ("GDM finished, cleaning up...");
+ signal (SIGTERM, on_signal_term_cb);
g_clear_object (&manager);
g_clear_object (&settings);
@@ -394,6 +426,10 @@ main (int argc,
gdm_settings_direct_shutdown ();
gdm_log_shutdown ();
+ jump_to_tty1 ();
+
+ g_debug ("GDM finished");
+
g_main_loop_unref (main_loop);
return EXIT_SUCCESS;