Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    2,103

    Quote Originally Posted by hazel View Post
    What I find so curious is that starting X is not really part of the boot process. Once the console login prompt comes up, booting should be over. X is just a program that you are starting. So why at that stage should there be a difference between a warm and a cold boot?

    What I observe in the case of a cold boot is that after sending startx, the console freezes completely for about 10 seconds. Then the first X message comes up, which is about the xauth file. From that point onward, everything happens more or less instantly. Does anyone know what X is actually doing during those 10 seconds?
    I don't often do a cold boot so I just did one on my laptop to see if I would experience this and I didn't. On this platform I don't see any difference in the time X takes. Could it be doing something like enabling 3d acceleration on the card?

  2. #12
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,454
    It's not X! It's not even xauth. Believe it or not, the problem lies with hostname. The startx script calls hostname first because xauth uses the host name as part of its authorisation string (along with the display name and an MIT cookie).

    Today I booted up from cold and immediately entered hostname -f, which is the form of the command that startx uses. It took nearly half a minute and then gave an error message because I don't have an official FQDN, only compaq.localdomain.

    But why it takes so much longer starting from cold is something I still don't understand.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #13
    Linux User IsaacKuo's Avatar
    Join Date
    Feb 2005
    Location
    Baton Rouge, LA, USA
    Posts
    448
    Quote Originally Posted by hazel View Post
    It's not X! It's not even xauth. Believe it or not, the problem lies with hostname. The startx script calls hostname first because xauth uses the host name as part of its authorisation string (along with the display name and an MIT cookie).

    Today I booted up from cold and immediately entered hostname -f, which is the form of the command that startx uses. It took nearly half a minute and then gave an error message because I don't have an official FQDN, only compaq.localdomain.

    But why it takes so much longer starting from cold is something I still don't understand.
    I don't understand what exactly is going on, but I can suggest some things to try to fix it.

    1) change /etc/hostname from compaq.localdomain to compaq (or vice versa). On my Debian machines, I always use /etc/hostname with just the machine name (no dot, no suffix). That is the default that the Debian installer does.

    2) Create an entry in /etc/hosts for compaq and compaq.localdomain, something like this:

    127.0.1.1 compaq.localdomain compaq
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  4. $spacer_open
    $spacer_close
  5. #14
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,454
    I think I've cracked it! I didn't have /etc/nsswitch.conf, so hostname didn't know where to go for its information. I suspect that the default source in that case is dns (can someone else confirm that?). My adsl router acts as my nameserver, so of course it goes round the net looking for compaq.localdomain and can't find it. Hence the delay.

    I don't have the router permanently on; I always switch it on when I switch on the cornputer. But when I reboot, the router is already on, so it has cached all the addresses it needs to use for a name search. Hence the difference in speed.

    I've copied over a nsswitch.conf file from another of my distros and now hostname -f is almost instantaneous. I'll check tomorrow what happens with a cold boot.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  6. #15
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    2,103
    Libc uses nss but "hostname -f" should default to /etc/hosts unless you are using bind or NIS:

    Form man hostname:
    -f, --fqdn, --long
    Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a short host name and the DNS domain name. Unless you are using bind or NIS for host lookups you can change the
    FQDN and the DNS domain name (which is part of the FQDN) in the /etc/hosts file. See the warnings in section THE FQDN above, and avoid using this option; use hostname --all-fqdns
    instead.

  7. #16
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,454
    Quote Originally Posted by gregm View Post
    Libc uses nss but "hostname -f" should default to /etc/hosts unless you are using bind or NIS.
    Oops, slight error on my part! I checked startx again and it only uses "hostname -f" if hostname --version contains the string "GNU", which isn't the case on Slackware 14. So the command used is just hostname. Does that make a difference?

    I booted from cold today. There was a pause for hostname resolution but not such a long one as before. This kind of sleuthing is fun, isn't it. The thing I like most about Linux (apart from being safe on the Internet) is that, when you have a problem, you can usually tease it out if you think logically. I can think of other OS's that you can't say that about!

    Edit: Here's a quote from the GNU libc manual, specifying what happens when nsswitch.conf is absent.
    "For the hosts and networks databases the default value is dns."
    That's what I thought.
    Last edited by hazel; 03-12-2014 at 04:54 PM.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  8. #17
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    2,103
    Quote Originally Posted by hazel View Post
    Oops, slight error on my part! I checked startx again and it only uses "hostname -f" if hostname --version contains the string "GNU", which isn't the case on Slackware 14. So the command used is just hostname. Does that make a difference?

    I booted from cold today. There was a pause for hostname resolution but not such a long one as before. This kind of sleuthing is fun, isn't it. The thing I like most about Linux (apart from being safe on the Internet) is that, when you have a problem, you can usually tease it out if you think logically. I can think of other OS's that you can't say that about!

    Edit: Here's a quote from the GNU libc manual, specifying what happens when nsswitch.conf is absent.
    "For the hosts and networks databases the default value is dns."
    That's what I thought.
    That makes sense. If hostname is called without a param it uses gethostname which is a libc function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •