LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Current64 - Sun Nov 19 03:36:30 UTC 2017 updates - login runlvl=3 minor inconsistency (https://www.linuxquestions.org/questions/slackware-14/current64-sun-nov-19-03-36-30-utc-2017-updates-login-runlvl%3D3-minor-inconsistency-4175617993/)

burdi01 11-20-2017 09:39 AM

Current64 - Sun Nov 19 03:36:30 UTC 2017 updates - login runlvl=3 minor inconsistency
 
Current64 - Sun Nov 19 03:36:30 UTC 2017 updates - login runlvl=3:
Code:

Slackware 14.2

riposo login: root
Password:
Login incorrect

riposo.burdi.nl login: root
Password:
Linux 14.4.0.
You have mail.
root@riposo:~#

:D

Edit: For a good understanding: The first time I entered a wrong password. The inconsistency I notice is that the first prompt uses the short hostname, whereas the second prompt uses the long hostname.

hitest 11-20-2017 09:55 AM

I never log in as root, but, I did try to reproduce your results. I logged out of my Slackware64-current work station running KDE. I successfully logged in as root at run level 3. I didn't see your result. Perhaps you typed the root password incorrectly?

burdi01 11-20-2017 11:52 AM

@hitest: I added an explanation to my initial post.
:D

GazL 11-20-2017 12:14 PM

The first password prompt is written to the screen by the /sbin/agetty process. After an invalid user/password entry, the second prompt is written by /bin/login.

My guess is that one is displaying the short hostname, and the other is displaying the nodename (uname -n). If these are different, then you see the discrepancy.

GazL 11-21-2017 03:03 AM

Code:

a/sysvinit-scripts-2.1-noarch-2.txz: Rebuilt.
      inittab: Have agetty display the FQDN, since /bin/login does.

I wish I hadn't said anything now. Pat has made it consistent for you and inconsistent for me (I use a shortname in /etc/HOSTNAME to keep things the same as how they were).

Besides,
"name.subdomain.domain.com login:" looks more ridiculous with every additional subdomain..


Oh well, I guess I'll just be using a custom inittab from here on in.

magicm 11-21-2017 09:16 AM

@GazL - just curious - how are you planning on customizing your inittab?

GazL 11-21-2017 10:12 AM

Oh, nothing fancy, just s/--long-hostname// to go back to displaying the shortname.

heyjann 11-22-2017 07:43 AM

For the record, or for posterity, from today's -current changelog:

Wed Nov 22 05:27:06 UTC 2017
[...]
a/shadow-4.2.1-x86_64-3.txz: Rebuilt.
Patched to display the short hostname on the login prompt.
a/sysvinit-scripts-2.1-noarch-3.txz: Rebuilt.
On second thought, let's keep using the short hostname on the login prompt
like we always have before. I'm with GazL on this one. :-)

TommyC7 11-22-2017 08:11 AM

Did today's patch work for anyone?

While I haven't restarted my -current laptop the rc.M.new didn't seem to change with respect to the hostname bits:

Code:

# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
  /bin/hostname $(cat /etc/HOSTNAME)
else
  # fall back on this old default:
  echo "darkstar.example.net" > /etc/HOSTNAME
  /bin/hostname darkstar
fi

I believe previously (when it was shortening the hostname) it was something like:
Code:

# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
  /bin/hostname $(cat /etc/HOSTNAME | cut -f 1 -d .)
else
  # fall back on this old default:
  echo "darkstar.example.net" > /etc/HOSTNAME
  /bin/hostname darkstar
fi


chrisVV 11-22-2017 08:44 AM

Quote:

Originally Posted by TommyC7 (Post 5783829)
Did today's patch work for anyone?

It more or less works. As slackware-current stands as of today for me, /bin/hostname without arguments returns the fully-qualified hostname, probably because I still have the FQDN in /etc/HOSTNAME, and I intend to leave it there. The shell prompt (the prompt you get after a successful login) in a console or X terminal shows a short-form hostname. If I go to a free console (say tty2) where there has been no login, the hostname is also given in short-form. However, if I make an unsuccessful login attempt at the console, then the prompt switches to a fully qualified hostname, and remains so until a successful login is made.

GazL 11-22-2017 10:46 AM

Quote:

Originally Posted by chrisVV (Post 5783843)
However, if I make an unsuccessful login attempt at the console, then the prompt switches to a fully qualified hostname, and remains so until a successful login is made.

That shouldn't be the case after this mornings updated shadow package and Pat's patch to /bin/login. /bin/login should now truncate the displayed hostname just like agetty does regardless of whether you use a short or fqdn in /etc/HOSTNAME.

This is from hostname(1)
Code:

  THE FQDN
      The  FQDN  (Fully Qualified Domain Name) of the system is the name that
      the resolver(3) returns for the host name, such as, ursula.example.com.
      It  is  usually  the hostname followed by the DNS domain name (the part
      after the first dot).  You can check the FQDN using hostname --fqdn  or
      the domain name using dnsdomainname.

      You cannot change the FQDN with hostname or dnsdomainname.

      The  recommended  method of setting the FQDN is to make the hostname be
      an alias for the fully qualified name using /etc/hosts,  DNS,  or  NIS.
      For  example,  if  the  hostname was "ursula", one might have a line in
      /etc/hosts which reads

              127.0.1.1    ursula.example.com ursula

      Technically: The FQDN is the name getaddrinfo(3) returns for  the  host
      name returned by gethostname(2).
The DNS domain name is the part after
      the first dot.

That to me seems to indicate that the hostname should be set to the short name and gethostname() should return that shortname.

chrisVV 11-22-2017 12:07 PM

Quote:

Originally Posted by GazL (Post 5783912)
That shouldn't be the case after this mornings updated shadow package and Pat's patch to /bin/login. /bin/login should now truncate the displayed hostname just like agetty does regardless of whether you use a short or fqdn in /etc/HOSTNAME.

It seems a reboot was necessary. Now it works as intended.


All times are GMT -5. The time now is 01:16 PM.