[PATCH 4/5] Introduce flags.preexisting_x11.

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

 



From: Ales Kozumplik <akozumpl@xxxxxxxxxx>

This way one can always determine whether it was us or somebody else who
started the X server and so whether the X11 is forwarded or if we run the
standard graphical installation.

Related: rhbz#663411
---
 anaconda |    7 ++++---
 flags.py |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/anaconda b/anaconda
index 187600e..2c16e36 100755
--- a/anaconda
+++ b/anaconda
@@ -894,6 +894,8 @@ if __name__ == "__main__":
     if iutil.memInstalled() < isys.MIN_GUI_RAM:
         flags.vncquestion = False
 
+    if os.environ.has_key('DISPLAY'):
+        flags.preexisting_x11 = True
 
     if opts.display_mode == 't' and flags.vncquestion: #we prefer vnc over text mode, so ask about that
         title = _("Would you like to use VNC?")
@@ -950,8 +952,7 @@ if __name__ == "__main__":
          opts.display_mode = 't'
 
     if opts.isHeadless: # s390/iSeries checks
-        if opts.display_mode == 'g' and not (os.environ.has_key('DISPLAY') or
-                                             flags.usevnc):
+        if opts.display_mode == 'g' and not (flags.preexisting_x11 or flags.usevnc):
             stdoutLog.warning(_("DISPLAY variable not set. Starting text mode."))
             opts.display_mode = 't'
             graphical_failed = 1
@@ -959,7 +960,7 @@ if __name__ == "__main__":
 
     # if DISPLAY not set either vnc server failed to start or we're not
     # running on a redirected X display, so start local X server
-    if opts.display_mode == 'g' and not os.environ.has_key('DISPLAY') and not flags.usevnc:
+    if opts.display_mode == 'g' and not flags.preexisting_x11 and not flags.usevnc:
         try:
             # The following code depends on no SIGCHLD being delivered, possibly
             # only except the one from a failing X.org. Thus make sure before
diff --git a/flags.py b/flags.py
index dbe5fae..702a30d 100644
--- a/flags.py
+++ b/flags.py
@@ -93,6 +93,7 @@ class Flags:
         self.__dict__['flags']['useIPv6'] = True
         self.__dict__['flags']['sshd'] = 0
         self.__dict__['flags']['noverifyssl'] = False
+        self.__dict__['flags']['preexisting_x11'] = False
         # for non-physical consoles like some ppc and sgi altix,
         # we need to preserve the console device and not try to
         # do things like bogl on them.  this preserves what that
-- 
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux