startx works only after altering xorg.conf

I have a weird problem with xorg.conf

For some reason, startx always simply show a black screen with a cursor. Cursor is responsive to movement but not to clicking, and keyboard is unresponsive except for Ctrl + Alt + F# combination. Upon returning to console, I'd su and alter /etc/xorg.conf and subsequent startx would perform as intended, showing the selected window-manager and other programs as defined in .xinitrc.

Altering xorg.conf, so far, includes renaming, simply deleting, reinstalling the previously failed backup, or just creating new where there was nothing. They all seem to work; the only important part seems to be that the xorg.conf that the system booted with (or lack there of) has been replaced or deleted or, or if there wasn't one to begin with, created. By the way, I don't know what happens if I simply edit the existing xorg.conf, though I'd think that would work, too.

This also doesn't seem to matter with the choice of the window-manager; .xinitrc had been configured to run twm, openbox, and just xterm, and they all behave the same. I also tried simply doing exec twm and this also confirm to the above observed behavior.

rc.conf has both entries for hald and dbus. I assumed the contents of xorg.conf is not much of a issue since lack there of doesn't seem to matter; it doesn't work unless it's been altered since boot.

How can I fix this?

The computer is booting FreeBSD 8-stable from a usb drive and is using Radeon x1250 graphics driver. Please let me know if you need log or other information; I'll do my best to fetch them.
 
Perhaps I wasn't clear.

I have used Xorg -configure tool to create the xorg.conf to begin with. And the contents of the file doesn't seem to have a baring to the problem. So long as it has been changed, or even plain deleted out of existence without a replacement, startx would suddenly work correctly, starting up all the program specified in .xinitrc. I could use the xorg.conf that didn't work previously and it would work, so long as it wasn't the xorg.conf that I booted with. I could leave everything blank, and startx would work so long as it wasn't the xorg.conf that I booted with.
And so long as xorg.conf remains un-deleted/un-moved/unchanged, startx would simply show a blank black screen w/ a screen no matter how many time I kill it and restart it. Hence I used the word wierd. Not having one on boot doesn't improve either; I need to change the fact that it wasn't there lest I am stuck with a black screen w/ a lone cursor that doesn't respond to any clicks.

It might be interesting to note that the same USB stick would function fine in a different computer regardless of the xorg.conf. I intentionally left it absent and the setup automatically found the setting for the intel G45 chipset.

Here are the two variant of xorg.conf files used. They both work, so long as the system didn't boot with it, and doesn't work if the system booted with it. Lack of them also work, so long as either of the two was present and then deleted. Not having any and then moving one of these as xorg.conf work just fine, too. I suppose the third xorg.conf I used would be a blank one.

xorg.conf.d
Code:
Section "ServerFlags"
	Option "BlankTime"	"0"
	Option "StandbyTime"	"0"
	Option "SuspendTime"	"0"
	Option "OffTime"	"0"
EndSection

xorg.conf.work
Code:
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "glx"
	Load  "dri"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "Dac6Bit"            	# [<bool>]
        #Option     "Dac8Bit"            	# [<bool>]
        #Option     "BusType"            	# [<str>]
        #Option     "CPPIOMode"          	# [<bool>]
        #Option     "CPusecTimeout"      	# <i>
        #Option     "AGPMode"            	# <i>
        #Option     "AGPFastWrite"       	# [<bool>]
        #Option     "AGPSize"            	# <i>
        #Option     "GARTSize"           	# <i>
        #Option     "RingSize"           	# <i>
        #Option     "BufferSize"         	# <i>
        #Option     "EnableDepthMoves"   	# [<bool>]
        #Option     "EnablePageFlip"     	# [<bool>]
        #Option     "NoBackBuffer"       	# [<bool>]
        #Option     "DMAForXv"           	# [<bool>]
        #Option     "FBTexPercent"       	# <i>
        #Option     "DepthBits"          	# <i>
        #Option     "PCIAPERSize"        	# <i>
        #Option     "AccelDFS"           	# [<bool>]
        #Option     "IgnoreEDID"         	# [<bool>]
        #Option     "CustomEDID"         	# [<str>]
        #Option     "DisplayPriority"    	# [<str>]
        #Option     "PanelSize"          	# [<str>]
        #Option     "ForceMinDotClock"   	# <freq>
        #Option     "ColorTiling"        	# [<bool>]
        #Option     "VideoKey"           	# <i>
        #Option     "RageTheatreCrystal" 	# <i>
        #Option     "RageTheatreTunerPort" 	# <i>
        #Option     "RageTheatreCompositePort" 	# <i>
        #Option     "RageTheatreSVideoPort" 	# <i>
        #Option     "TunerType"          	# <i>
        #Option     "RageTheatreMicrocPath" 	# <str>
        #Option     "RageTheatreMicrocType" 	# <str>
        #Option     "ScalerWidth"        	# <i>
        #Option     "RenderAccel"        	# [<bool>]
        #Option     "SubPixelOrder"      	# [<str>]
        #Option     "ClockGating"        	# [<bool>]
        #Option     "VGAAccess"          	# [<bool>]
        #Option     "ReverseDDC"         	# [<bool>]
        #Option     "LVDSProbePLL"       	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "DRI"                	# [<bool>]
        #Option     "ConnectorTable"     	# <str>
        #Option     "DefaultConnectorTable" 	# [<bool>]
        #Option     "DefaultTMDSPLL"     	# [<bool>]
        #Option     "TVDACLoadDetect"    	# [<bool>]
        #Option     "ForceTVOut"         	# [<bool>]
        #Option     "TVStandard"         	# <str>
        #Option     "IgnoreLidStatus"    	# [<bool>]
        #Option     "DefaultTVDACAdj"    	# [<bool>]
        #Option     "Int10"              	# [<bool>]
        #Option     "EXAVSync"           	# [<bool>]
        #Option     "ATOMTVOut"          	# [<bool>]
        #Option     "R4xxATOM"           	# [<bool>]
        #Option     "ForceLowPowerMode"  	# [<bool>]
        #Option     "DynamicPM"          	# [<bool>]
        #Option     "NewPLL"             	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
	Identifier  "Card0"
	Driver      "radeon"
	VendorName  "ATI Technologies Inc"
	BoardName   "Radeon Xpress 1250"
	BusID       "PCI:1:5:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "ServerFlags"
	Option "BlankTime"	"0"
	Option "StandbyTime"	"0"
	Option "SuspendTime"	"0"
	Option "OffTime"	"0"
EndSection
 
I'm not following?

You say if you boot with? Which to me would mean that you are booting the system into xdm or some such other display manager - which would negate the use of startx.

With the new Xorg, you don't specifically need an xorg.conf file unless there is something wrong. So if it working without the file, I'd leave it gone.

Have you check the xorg logs for any hints.
 
y2s82 said:
I have a weird problem with xorg.conf

For some reason, startx always simply show a black screen with a cursor. Cursor is responsive to movement but not to clicking, and keyboard is unresponsive except for Ctrl + Alt + F# combination. Upon returning to console, I'd su and alter /etc/xorg.conf and subsequent startx would perform as intended, showing the selected window-manager and other programs as defined in .xinitrc.

You sure about that path to xorg.conf? While many use /etc/X11/xorg.conf, I prefer to keep it in /usr/local/etc/X11/xorg.conf. That's where it should be according to hier(7).

Altering xorg.conf, so far, includes renaming, simply deleting, reinstalling the previously failed backup, or just creating new where there was nothing. They all seem to work; the only important part seems to be that the xorg.conf that the system booted with (or lack there of) has been replaced or deleted or, or if there wasn't one to begin with, created. By the way, I don't know what happens if I simply edit the existing xorg.conf, though I'd think that would work, too.

This also doesn't seem to matter with the choice of the window-manager; .xinitrc had been configured to run twm, openbox, and just xterm, and they all behave the same. I also tried simply doing exec twm and this also confirm to the above observed behavior.

That sounds wrong, but I guess could be caused by permissions. Occasionally there's an error caused by .Xauthority, made more frustrating by rarity.

rc.conf has both entries for hald and dbus.

Good, but are they installed and running? rc.conf guarantees neither.

Radeon X1250 should work fine, I've got a notebook with one of those here. Here is the xorg.conf from it, comments stripped to de-embiggen it:
Code:
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/lib/X11/fonts/misc/"
        FontPath     "/usr/local/lib/X11/fonts/TTF/"
        FontPath     "/usr/local/lib/X11/fonts/OTF"
        FontPath     "/usr/local/lib/X11/fonts/Type1/"
        FontPath     "/usr/local/lib/X11/fonts/100dpi/"
        FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "DRI"
        Group 0
        Mode  0660
EndSection

Section "Module"
        Disable "record"
EndSection      

Section "Device"
        Identifier  "Card0"
        Driver      "radeon"
        Option      "AccelMethod" "EXA"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Virtual 1280 800
        EndSubSection
EndSection
 
@robbierod
No, I'm not using xdm/slim/gdm/kdm or any other varient. By "boot with" I meant the file was present when booting. It was there when the system shut down previously. xorg.conf "worked" before shutdown and, after reboot, it doesn't unless, well, changed. The setup on that computer doesn't work with or without xorg.conf; it works only after it's been replaced or deleted or created. And the same setup (with the same bootable usb stick) works fine in other computers regardless of the xorg.conf.

@wblock
Ah, the location of the xorg.conf was a typo; it's in /etc/X11/xorg.conf. Only recently I've been reading up on the more appropriate location. Perhaps I should follow the advice :)

I did see a couple of entries about .Xauthority while the X server was starting up. I really should go fetch that log file... If such is the case, how would I go about fixing it?

About hald and dbus, I rather supposed they are installed through portmaster command to install x11/xorg The installations, along with other ports, went without a hick-up. Further, since the mouse and keyboard work on other computers, I assumed the hald and dbus were installed and working.

Just to make sure I give a more appropriate picture, the system is installed on a USB drive from a FreeBSD 8-stable from source code. It also took the GEOM labeling and /etc/fstab from another site:
Code:
# Device		Mountpoint	FStype	Options		Dump	Pass#
/dev/ufs/FBSDonUSB	/		ufs	rw			1	1
md			/tmp		mfs	rw,-s16M,nosuid,noatime	0	0
md			/var/tmp	mfs	rw,-s16M,nosuid,noatime	0	0
md			/var/run	mfs	rw,-s4M,nosuid,noatime	0	0
/tmp			/var/tmp	nullfs	rw			0	0
/dev/acd0		/cdrom		cd9660	ro,noauto,nosuid	0	0
#proc			/proc		procfs	rw			0	0
Hmmm, could the available memory have to do with the trouble? dmesg says the system has 732 mb, running a GENERIC kernel.

The port installation method was taken from here: I mounted a slice from an installation of freebsd on a magnetic drive (the usb installation took place with the source code from the same system) and ln -s the ports folder from the mounted slice to /usr/ports of the usb stick and performed all port installation as ordinary with portmaster. So far, vi works, pf works, sshd works, sound works, mplayer works (playing audio), feh, conky, firefox3, xterm works once the startx works. I'm not sure if there's a way to say with certainty that the installation went proper, but I'm inclined to think it did, both for base and ports.

Thanks for the working copy of the xorg.conf. I'll try it out.
 
Edit: the Xorg.0.log is linked below. Thank you mod :)

On the screen, after killing the first startx session, I see these lines among others:
Code:
xauth: creating new authority file /home/PicF/.Xauthority
xauth: (argv):1:  bad display name ":0" in "remove" command
xauth: (argv):1:  bad display name ":0" in "remove" command

These appear once in the beginning, and once again after ^c character.
 
Don't see anything immediately obvious with the log. Does it help to chmod 1777 /tmp before trying to start X?
 
Yesterday, while trying to check out /tmp by mounting the usb drive on another FreeBSD machine, I found out that the slice was somehow corrupted. I've ran fsck but I'm now rather inclined to just start fresh.

I also wonder if it's possible that the USB drive is starting to deteriorate already (less than two weeks of use :( )

I'll check back once I've deleted and reinstalled the whole thing. Thanks everyone for helping me out so far. I think I learned quite a bit :)
 
Back
Top