LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   x works setting inittab in 4 but not three (https://www.linuxquestions.org/questions/slackware-14/x-works-setting-inittab-in-4-but-not-three-686199/)

okos 11-26-2008 12:13 AM

x works setting inittab in 4 but not three
 
This is rather frustrating :(

Recently I changed my inittab to runlevel 4 for convience. Yesterday I changed it back to 3 and rebooted. I got the following error and could not startx

Quote:

Fatal server error:
Unrecognized option: no listen

giving up.
xinit: No such file or directory (error2): unable to connect to x server
xinit: No such process (error3): server error.
I changed back to runlevel 4 and x started with no problem.

Any clues?

SqdnGuns 11-26-2008 12:23 AM

Not to sure if this may help but this guy had a somewhat similar situation. He found a workaround but no explanation as to why it happened.

Code:

Well -- seems nobody knows any better than I... {:-/) Got no suggestions.

I have, however, found the solution, if not the explanation [which I'd
still really like!]. The system runs by default at runlevel 3, and I
was doing (in the period when it worked) 'xinit' to start an X environment
from my account. This is what was failing as above. (For users -- root
could still start the X server.)

For grins I finally did a 'telinit 5' (remotely)... and saw the graphic
login screen immediately pop up on the console! From there I could log
in as a user and get my normal X environment.

I then did 'telinit 3' again, and now my 'xinit' works properly just as
it did before!

My (wild) guess -- trying to parse the documentation on "PAM and Device
Ownership" -- is that somehow the "console user" was locked off somewhere
that it shouldn't have been, so I was never getting the console privileges
I should have. No real idea, but hopefully if it happens again, the same
cure will work...

Source:

http://forum.soft32.com/linux/Server...ict354528.html

shadowsnipes 11-26-2008 08:45 PM

try running xwmconfig to reset what your ~/.xinitrc is. Did your permissions get changed on any of your X server files?

okos 11-26-2008 10:03 PM

Thanks, but I think that is a stab in the dark.

I don't think slackware uses pam.
Since I never access my box via remote, I disabled ssh and never used telnet before.

I googled around for a while but still have not found a solution. I guess there could be a great variety of reasons.

What if I deleted xorg.conf would it build a new one?
I guess I could try xorgconfig and see what possible changes might be done.

I tried reinstalling the nvidia driver but it did not good.

I could not find the xorg log anywhare on my system to find greater details as to what is causing the problem.

SqdnGuns 11-26-2008 10:17 PM

Quote:

Originally Posted by okos (Post 3356189)
Thanks, but I think that is a stab in the dark.

I don't think slackware uses pam.
Since I never access my box via remote, I disabled ssh and never used telnet before.

I googled around for a while but still have not found a solution. I guess there could be a great variety of reasons.

What if I deleted xorg.conf would it build a new one?
I guess I could try xorgconfig and see what possible changes might be done.

I tried reinstalling the nvidia driver but it did not good.

I could not find the xorg log anywhare on my system to find greater details as to what is causing the problem.

Yeah, I know it doesn't use PAM unless you have DLG installed.

Don't delete your xorg.conf, just back it up and run xorgconfig again and just use the "vesa" or "nv" driver. After you run xorgconfig, then compare it to your backed up one to see what the culprit might be, granted it works.

I have no clue but you maybe on the right track to figure it out.

okos 11-26-2008 10:47 PM

Quote:

Originally Posted by SqdnGuns (Post 3356201)
just use the "vesa" or "nv" driver. After you run xorgconfig, then compare it to your backed up one to see what the culprit might be, granted it works.

I am not sure how you select a different driver.

I restored the xorg.conf that I backed up some time ago and still no good. I also tried a second kernel on my system to no avail.

:(

Woodsman 11-26-2008 11:18 PM

When init 3 is the default, Slackware will do nothing after running /etc/rc.d/rc.M. The user logs in and in the stock Slackware, nothing happens. The user then types startx to start X. startx is a shell script located in /usr/bin. The startx script looks for certain files when starting X. If the user has a .xinitrc file in $HOME, then that file gets used for customization. If not then the default system xinitrc located in /etc/X11/xinit is used. The /etc/X11/xinit/xinitrc file is a soft link to one of the xinit files located in the same directory.

When init 4 is the default, Slackware runs rc.M but then init runs rc.4, which is defined in /etc/inittab.

That the system runs X fine in init 4 but not in init 3 indicates a problem with either $HOME/.xinitrc or /etc/X11/xinit/xinitrc. Running xwmconfig as root will properly link /etc/X11/xinit/xinitrc to the desired xinit file. Running xwmconfig as non-root creates a new $HOME/.xinitrc. Consider trying both operations.

SqdnGuns 11-26-2008 11:23 PM

Quote:

Originally Posted by Woodsman (Post 3356257)
When init 3 is the default, Slackware will do nothing after running /etc/rc.d/rc.M. The user logs in and in the stock Slackware, nothing happens. The user then types startx to start X. startx is a shell script located in /usr/bin. The startx script looks for certain files when starting X. If the user has a .xinitrc file in $HOME, then that file gets used for customization. If not then the default system xinitrc located in /etc/X11/xinit is used. The /etc/X11/xinit/xinitrc file is a soft link to one of the xinit files located in the same directory.

When init 4 is the default, Slackware runs rc.M but then init runs rc.4, which is defined in /etc/inittab.

That the system runs X fine in init 4 but not in init 3 indicates a problem with either $HOME/.xinitrc or /etc/X11/xinit/xinitrc. Running xwmconfig as root will properly link /etc/X11/xinit/xinitrc to the desired xinit file. Running xwmconfig as non-root creates a new $HOME/.xinitrc. Consider trying both operations.

I trust what you and shadowsnipes has to say on this. It all makes perfect when you spell it out like that. The technical writing has paid off..... ;)

okos 11-27-2008 12:35 AM

Woodsman,
I greatly appreciate the help and the lesson on how things work.

I tried xwmconfig for both root and user with out success :(

Could the /etc/X11/xinit/xinitrc.kde file somehow got corrupted?

BTW I ran xwmconfig by opening up a console while in runtime 4, edited inittab and rebooted. Only to come up with the same error.

Could I copy the xinitrc.kde from the slack disks?

okos 11-27-2008 10:45 AM

In runtime 3 I changed to xfce and then fluxbox using xwmconfig. Still to no avail I get the same error. Therefore, I can deduce that xinitrc.kde is not corrupt.

The same thing happens for either root or user.

I am not sure what else to do.

H_TeXMeX_H 11-27-2008 11:37 AM

I say take a look at '/usr/bin/startx' and post the first 30 lines at least.

Woodsman 11-27-2008 12:07 PM

As H_TeXMeX_H mentioned, perhaps /usr/bin/startx is corrupt. In 12.1 that shell script is installed from the x/xinit-1.0.8-i486-1.tgz package. You might want to reinstall that package.

If you have a file named $HOME/.xsession-errors then look in that log file for errors or clues.

If you do not have such a file then watch the screen for error messages.

Another log to check is /var/log/Xorg.0.log. Typically X will start with warnings but not always start with errors. To search the file for errors (EE) and warnings (WW):

grep '(EE)' /var/log/Xorg.0.log
grep '(WW)' /var/log/Xorg.0.log

GazL 11-27-2008 02:18 PM

"no listen" sounds like it might be the -nolisten parameter of the Xserver. It's possible that someone or some package was trying to tighten security a little by setting this parameter but hasn't quite gotten the syntax right.

I usually start X11 with a

startx -- -nolisten tcp

If you want to set nolisten to be a default for startx, one common way is to create a
~/.xserverrc file containing the parameter, or /etc/X11/xinit/xserverrc if its been done system wide. It could possibly be in other files though.

if you don't have any luck looking in those two files, try to see if you can find it with a
grep 'listen' ~/.x*

okos 11-27-2008 03:30 PM

GazL,

That did the trick!
Thanks a bunch!
A while back, I followed some of the pointers in Slackware System Hardening by Jeffery Denton. Since I have been using runtime 4 for a while, I would not have noticed the problem upon rebooting. Luckily I copied the tutorial to word processing and highlighted all of the steps I had taken. I can therefore sequentially change back what I has previously incorporated into my system. Furthermore, here is an excerpt about closing ports in his tutorial:
Code:

/usr/X11R6/bin/startx:
    defautserverargs="-nolisten tcp"

    Closes TCP port 6000+n, where n is $DISPLAY (the default is 0).
   
   
/etc/X11/xdm/Xservers:
    :0 local /usr/X11R6/bin/X -nolisten tcp

    Closes TCP port 6000.
   
    /etc/X11/xdm/Xaccess:
    Make sure everything is commented.

   
/etc/rc.d/rc.4:
    exec /usr/X11R6/bin/xdm -nodaemon -udpPort 0

    Closes UDP port 177.
   
   
/etc/X11/fs/config:
    use-syslog = yes
    no-listen = tcp


I have two questions a little off topic,

1. Why does x require the above ports to be kept open. Specifically port 6000? Is it that x can be run as a server for multiple computers to access? What is the point of the x server?

2. SqdnGuns stated, "just use the "vesa" or "nv" driver". How do you switch video drivers?

This has been a most educational process. I greatly appreciate all of your help. :)

GazL 11-27-2008 03:44 PM

Quote:

Originally Posted by okos (Post 3357079)
GazL,

That did the trick!
Thanks a bunch!

I have two questions a little off topic,

1. Why does x require the above ports to be kept open. Specifically port 6000? Is it that x can be run as a server for multiple computers to access? What is the point of the x server?

2. SqdnGuns stated, "just use the "vesa" or "nv" driver". How do you switch video drivers?

This has been a most educational process. I greatly appreciate all of your help. :)

Your welcome matey. Glad to help.


1 X is network aware. what that means is that I can run a X application on one server and have it display its windows on another X screen running on a different box entirely. You do this by setting the $DISPLAY variable before running the application. It works over tcp. Port 6000 sits there listening for these incoming connections, which is why specifying -nolisten tcp can help improve the security of your box a little bit.

2 the Xserver driver is set in /etc/X11/xorg.conf in the Device section.


All times are GMT -5. The time now is 07:32 PM.