1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I recover login after installing xdm?

Discussion in 'General' started by lucky7456969, Oct 10, 2012.

  1. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    I can't login to FreeBSD after installing xdm. I used 'root' as the user when I changed ttys
    file. As I log back in using single user mode, there is no text editor that I can use to change it back to its normal condition.
    How to make myself loginable to the system again?
    Thanks
    Jack
     
  2. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Boot to single user mode then:
    Code:
    fsck -y
    mount -u /
    mount -a -t ufs
    swapon -a
    
    After that the editors should be available and you should be able to edit /etc/ttys.
     
  3. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    Thanks Expert SirDice, it is okay now.
    But how do I avoid login failure after installing xdm, is the 'root' account the key?
    Thanks
    Jack
     
  4. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Try logging in with a 'regular' user account. See if that works. But I don't think XDM prevents root from logging in, not recommended but it should work.

    Did you perhaps install x11/xorg-minimal instead of x11/xorg? The latter contains the default window manager TWM. If it's not installed you will have to install an alternative and make sure it's started from your ~/.xinitrc (or was it ~/.xsession, symlink the two to make sure).
     
  5. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Don't ever do that again!
     
  7. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    When I turn on xdm, I am still unable to login.
    Either by "regular" user or "root"
    Any further advices?
    Thanks
    Jack
     
  8. adamk

    adamk New Member

    Messages:
    1,624
    Likes Received:
    0
    Explain what you mean by "unable to login." Does the graphical login screen not come up? Does X work if you don't use xdm?
     
  9. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    When I type the user name on the graphical login screen and password, it says the username/password is not correct. When I change it back (tyvs, off xdm), I can login thru the text login prompt.
    Thanks
    Jack
     
  10. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Do you have a different keyboard layout? It might have reverted back to a US layout.
     
  11. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    Dear SirDice,
    I have the default keyboard layout, as far as I recall, I did not change anything when I installed the system.
    Thanks
    Jack
     
  12. gpw928

    gpw928 New Member

    Messages:
    69
    Likes Received:
    0
    Hi Jack,

    The login process is handled by xdm. So try restarting xdm, and login via X as a normal user. If that fails, log back in as root via the console and tell us what the following show.

    Run this:
    Code:
    grep "xdm:" /var/log/messages
    Then look in:
    1. /var/log/xdm.log; and
    2. $HOME/.xsession-errors for that user
    for any error messages indicating any reason for a login error.

    If that provides no leads, we would expect this to show no differences:
    Code:
    diff /usr/local/share/examples/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config
    Finally, it may help for us to see the output of the following:
    Code:
    ls -laR /usr/local/lib/X11/xdm
    
    Cheers,
     
  13. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    I start commenting out the Xconsole line of the Xsetup_0 file.
    It works for "root" and it doesn't work for other accounts. (can't login)
    And The system becomes very unstable
     
  14. fluca1978

    fluca1978 New Member

    Messages:
    733
    Likes Received:
    0
    If works for root than it is probably a permission problem, even if it is still not clear to me what the problem is. You cannot login as normal user into the console (text-mode), into the display manager, or what? Please provide also the logs information as suggested in a previous post.
     
  15. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    Here is the xdm.log
    I don't have an .xsession-errors file in my $HOME/ directory
    This is just the root one
     

    Attached Files:

  16. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Code:
    xdm info (pid 1524): sourcing /usr/local/lib/X11/xdm/Xsetup_0
    /usr/local/lib/X11/xdm/Xsetup_0: !#/usr/local/bin/bash: not found
    
    Install shells/bash. If it's installed open that file, the first line should begin with '#!' not '!#'.
     
  17. lucky7456969

    lucky7456969 New Member

    Messages:
    39
    Likes Received:
    0
    I've got his however. This is the returned message after I typed in the login name and password
     

    Attached Files:

  18. gpw928

    gpw928 New Member

    Messages:
    69
    Likes Received:
    0
    Hi Jack,

    As SirDice points out, the xdm log shows a serious error in the file /usr/local/lib/X11/xdm/Xsetup_0. You must correct this (but see below).

    The logs you posted suggest to me that there's been a fair bit of hackery to the standard X11 setup. I can't see what version of FreeBSD you are running, but it seems odd to me that Xsetup_0 is running a bash script (I would expect /bin/sh).

    Mine (which is admittedly old) looks like this, and unless you have a good reason, yours probably should too:
    Code:
    #!/bin/sh
    # $Xorg: Xsetup_0,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
    xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
    Also the diff you sent of xdm-config shows "DisplayManager*authorize" has been set "false". I would expect this to be "true" on a clean system. The default xdm-comfig is a really good place to start. So unless you know better, you should (as root):

    Code:
    cp -p /usr/local/lib/X11/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config.bad
    cp /usr/local/share/examples/xdm/xdm-config /usr/local/lib/X11/xdm/xdm-config
    While we are here, you should check that rest of the files in /usr/local/lib/X11/xdm for modifications. Investigate anything you find with this:
    Code:
    cd /usr/local/share/examples/xdm/
    for f in *
    do
      echo "=== $f"
      diff $f /usr/local/lib/X11/xdm/$f
    done
    Cheers,