Re: Reasons to preseve X on tty7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 30, 2008 at 1:29 PM, Bill Nottingham <notting@xxxxxxxxxx> wrote:
> Dan Nicholson (dbn.lists@xxxxxxxxx) said:
>> Yeah, I realized that later. The writing of /var/spool/gdm/whatever
>> should be done from /etc/event.d/tty1, since that's the only place you
>> really know it's appropriate. I changed it so that it only happens on
>> initial boot to runlevel 5 (`runlevel` = "N 5"). There is still the
>> problem where getty is not started on tty1 when the display manager is
>> not gdm. That would require some more smarts between /etc/event.d/tty1
>> and /etc/event.d/prefdm. But that's no different than the current
>> situation. I'm confident this can be done correctly, though. Patch
>> attached.
>
> Doesn't this just create a race between tty1 writing the file
> and gdm trying to read it?

Oh, very good point. Let's try again. In the attached patch, all the
logic is handled in event.d/prefdm. In particular, when we want to
spawn a getty on tty1, we use initctl to emit a new event
"tty1-getty". This also includes some logic to try to make sure that
the display manager is gdm before assuming that it will be able to
start on tty1.

What do you think?

--
Dan
diff --git a/event.d/prefdm b/event.d/prefdm
index 7098bd7..52500ff 100644
--- a/event.d/prefdm
+++ b/event.d/prefdm
@@ -9,4 +9,24 @@ stop on runlevel [!5]
 console output
 respawn
 respawn limit 10 120
-exec /etc/X11/prefdm -nodaemon
+script
+	FORCEACTIVEVT=yes
+	DISPLAYMANAGER=""
+	[ -f /etc/sysconfig/desktop ] && . /etc/sysconfig/desktop
+	set $(runlevel || true)
+	if [ "$1" = N ] && [ "$2" = 5 ] && \
+		[ "$FORCEACTIVEVT" = yes ] && [ -w /var/spool/gdm ]
+	then
+		case "$DISPLAYMANAGER" in
+		GNOME|*gdm|"")
+			touch /var/spool/gdm/force-display-on-active-vt
+			;;
+		*)
+			/sbin/initctl emit --no-wait tty1-getty
+			;;
+		esac
+	else
+		/sbin/initctl emit --no-wait tty1-getty
+	fi
+	/etc/X11/prefdm -nodaemon
+end script
diff --git a/event.d/tty1 b/event.d/tty1
index 7747d66..b3e8543 100644
--- a/event.d/tty1
+++ b/event.d/tty1
@@ -6,6 +6,7 @@
 start on stopped rc2
 start on stopped rc3
 start on stopped rc4
+start on tty1-getty
 
 stop on runlevel 0
 stop on runlevel 1
-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux