Bug 517051 - "xconfig --startxonboot" in kickstart causes traceback on headless system
"xconfig --startxonboot" in kickstart causes traceback on headless system
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda (Show other bugs)
5.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Chris Lumens
Release Test Team
:
: 556735 594786 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-12 09:39 EDT by Jan Stodola
Modified: 2013-07-11 20:03 EDT (History)
11 users (show)

See Also:
Fixed In Version: anaconda-11.1.2.210-1
Doc Type: Bug Fix
Doc Text:
When anaconda executes the "xconfig --startxonboot" command in a kickstart file, it sets monitor parameters. Previously, anaconda did not test to see that a monitor was attached to the system before it attempted to set these parameters. When a monitor was not present, anaconda crashed. Anaconda now attempts to set monitor parameters only when a monitor is attached to the system and therefore avoids a crash when the "xconfig --startxonboot" kickstart command is run on a system without a monitor. (BZ#517051)
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 16:52:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
traceback on s390 (2.19 KB, text/plain)
2009-08-12 09:41 EDT, Jan Stodola
no flags Details
patch for headless systems (826 bytes, patch)
2009-12-18 14:48 EST, Jeff Bastian
no flags Details | Diff

  None (edit)
Description Jan Stodola 2009-08-12 09:39:04 EDT
Description of problem:
Running kickstart installation with "xconfig --startxonboot" option causes anaconda traceback.
This is reproducible at least on s390, headless ppc and x86_64 running in qemu using "-vga none" option, ie:

qemu-kvm -hda images/15G.img -m 512 -net nic,model=virtio -net user -kernel <path_to_vmlinuz> -initrd <path_to_initrd.img> -append "ks=<path_to_kickstart> serial" -nographic -serial stdio -vga none

Version-Release number of selected component (if applicable):
RHEL5.4 RC1,  anaconda-11.1.2.195-1

How reproducible:
100%

Steps to Reproduce:
1. create kickstart with "xconfig --startxonboot" option in it
2. use this kickstart to install headless system

  
Actual results:
traceback from x86_64 and ppc:

Traceback (most recent call last):
  File "/usr/bin/anaconda", line 962, in ?
    instClass.setInstallData(anaconda)
  File "/usr/lib/anaconda/kickstart.py", line 900, in setInstallData
    self.ksparser.readKickstart(self.file)
  File "/usr/lib/python2.4/site-packages/pykickstart/parser.py", line 1184, in readKickstart
    self.handleCommand(lineno, args)
  File "/usr/lib/anaconda/kickstart.py", line 788, in handleCommand
    self.handler.handlers[cmd](cmdArgs)
  File "/usr/lib/anaconda/kickstart.py", line 682, in doXConfig
    dict["startX"])
  File "/usr/lib/anaconda/installclass.py", line 422, in configureX
    self.setMiscXSettings(id, depth, resolution, runlevel = rl)
  File "/usr/lib/anaconda/installclass.py", line 337, in setMiscXSettings
    id.xsetup.xserver.hwstate.choose_sane_default()
AttributeError: 'NoneType' object has no attribute 'xserver' 


Expected results:
no traceback, successful installation
Comment 1 Jan Stodola 2009-08-12 09:41:12 EDT
Created attachment 357169 [details]
traceback on s390

Traceback on s390 is different from traceback on ppc and x86_64.
Comment 2 Philippe Brieu 2009-11-06 18:58:43 EST
We are seeing the same problem (and will open a case with RH technical support).
Comment 3 Philippe Brieu 2009-11-06 19:06:59 EST
Service request #1968610 has been opened about this problem.
Comment 4 Jeff Bastian 2009-12-16 11:01:13 EST
You can work around this bug with a %pre script in your kickstart file.  For example:


install
vnc
keyboard us
lang en_US

...

%include /tmp/xconfig.txt

%pre
if lspci | grep VGA ; then
  echo 'xconfig --startxonboot' > /tmp/xconfig.txt
else
  echo 'skipx' > /tmp/xconfig.txt
fi

%packages
@Core
@GNOME Desktop Environment

%post
...
Comment 5 Jeff Bastian 2009-12-18 14:48:01 EST
Created attachment 379281 [details]
patch for headless systems

This patch (from Issue Tracker 376424) fixed the problem for me when testing on a headless Xen guest.
Comment 6 Martin Banas 2010-01-19 09:26:30 EST
*** Bug 556735 has been marked as a duplicate of this bug. ***
Comment 7 Chris Lumens 2010-01-19 16:25:06 EST
I wonder if something like the following might be more comprehensive:

diff --git a/kickstart.py b/kickstart.py
index e9caeaa..59c9916 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -349,6 +349,9 @@ class AnacondaKSHandlers(KickstartHandlers):
 
     def doMonitor(self, args):
         KickstartHandlers.doMonitor(self, args)
+        if self.id.isHeadless:
+            return
+
         dict = self.ksdata.monitor
         self.skipSteps.extend(["monitor", "checkmonitorok"])
         self.id.instClass.setMonitor(self.id, dict["hsync"], dict["vsync"],
@@ -724,6 +727,9 @@ class AnacondaKSHandlers(KickstartHandlers):
 
     def doXConfig(self, args):
         KickstartHandlers.doXConfig(self, args)
+        if self.id.isHeadless:
+            return
+
         dict = self.ksdata.xconfig
 
         self.id.instClass.configureX(self.id, dict["driver"], dict["videoRam"],
Comment 8 Jan Stodola 2010-01-28 06:15:23 EST
Is there any updates.img, so I can retest with proposed changes?
Comment 12 Chris Lumens 2010-05-21 11:46:01 EDT
*** Bug 594786 has been marked as a duplicate of this bug. ***
Comment 13 RHEL Product and Program Management 2010-06-04 11:58:32 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 14 Chris Lumens 2010-07-16 10:45:23 EDT
> Is there any updates.img, so I can retest with proposed changes?    

updates=http://clumens.fedorapeople.org/517051.img
Comment 15 Jan Stodola 2010-07-27 07:56:46 EDT
Retested with updates.img from comment 14, using RHEL5.5 on ppc.
Kickstart contained:
xconfig --startxonboot


Traceback (most recent call last):
  File "/usr/bin/anaconda", line 930, in ?
    instClass.setInstallData(anaconda)
  File "/tmp/updates/kickstart.py", line 955, in setInstallData
    self.ksparser.readKickstart(self.file)
  File "/usr/lib/python2.4/site-packages/pykickstart/parser.py", line 1209, in readKickstart
    self.handleCommand(lineno, args)
  File "/tmp/updates/kickstart.py", line 843, in handleCommand  
    self.handler.handlers[cmd](cmdArgs)
  File "/tmp/updates/kickstart.py", line 737, in doXConfig
    dict["startX"])
  File "/usr/lib/anaconda/installclass.py", line 425, in configureX 
    self.setMiscXSettings(id, depth, resolution, runlevel = rl)
  File "/usr/lib/anaconda/installclass.py", line 340, in setMiscXSettings
    id.xsetup.xserver.hwstate.choose_sane_default()
AttributeError: 'NoneType' object has no attribute 'xserver'
Comment 16 Chris Lumens 2010-07-27 10:30:39 EDT
Ah, because isHeadless hasn't been set yet.  Could you give it another test with the same updates location?  Thanks.
Comment 17 Jan Stodola 2010-07-28 04:30:44 EDT
It is working fine now, tested on ppc and s390x.
Comment 19 Jan Stodola 2010-09-29 07:53:01 EDT
Retested on build RHEL5.6-Server-20100928.0/s390x with anaconda-11.1.2.215-1, there was no traceback when running kickstart installation containing the command:
"xconfig --startxonboot"

Moving to VERIFIED.
Comment 20 Ruediger Landmann 2011-01-06 21:35:55 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Anaconda ensures that a monitor is attached before it sets monitor 
parameters when the "xconfig --startxonboot" kickstart command is 
specified in a kickstart file and therefore avoids a crash on systems 
without a monitor. (BZ#517051)
Comment 21 Ruediger Landmann 2011-01-06 21:36:40 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1,8 @@
-Anaconda ensures that a monitor is attached before it sets monitor 
+When anaconda executes the "xconfig --startxonboot" command in a 
-parameters when the "xconfig --startxonboot" kickstart command is 
+kickstart file, it sets monitor parameters. Previously, anaconda did not 
-specified in a kickstart file and therefore avoids a crash on systems 
+test to see that a monitor was attached to the system before it attempted 
-without a monitor. (BZ#517051)+to set these parameters. When a monitor was not present, anaconda 
+crashed. Anaconda now attempts to set monitor parameters only when a 
+monitor is attached to the system and therefore avoids a crash when 
+the "xconfig --startxonboot" kickstart command is run on a system without 
+a monitor. (BZ#517051)
Comment 23 errata-xmlrpc 2011-01-13 16:52:49 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0030.html

Note You need to log in before you can comment on or make changes to this bug.