9

I have a question that arose in my mind after upgrading to 14.04 TrustyTahr from 12.04 PrecisePangolin. The question pertains to the 'who' command, and its output. On previous editions of Ubuntu the output the who command would read what tty was used to login and initiate the system and lightdm, for example:

:~$ who
geo      tty7     thedate (:0)
geo      pts/n    thedate (:0.0)

But on 14.04 TrustyTahr, when I run the who command my output yields:

:~$ who
geo      :0       thedate (:0)
geo      pts/n    thedate (:0.0)

On both editions the vt7 handoff is happening in /boot, and on TrustyTahr my XDG_VTNR variable is 7 when I login via lightdm; but tty7, nor vt7 is printed to the utmp file. This annoyed me for months, I finally wrote a c++ program, that incorporates the popen function, as a supplement to the who command in order for the who command to display the current XDG_VTNR with a tty coefficient e.g.:

geo      tty7         2015-06-04 20:54 (:0)
geo      pts/0        2015-06-04 20:54 (:0.0)

None the less why has this changed? And also is mine the only one like that, cause I downloaded this around May of last year, and I might have gotten a bunk iso or something, everytime I run the who command it makes me think of that Beastie Boys song: Sabotage (jk its not the bad).

oOpSgEo
  • 539

1 Answers1

2

Try upgrading the package that contains the who command; even if you did use a strange version of the ISO to install from, an update should replace it:

Find out what package owns who:

which who    # find out where 'who' binary is
dpkg -S /path/to/who

Then:

apt-get update
apt-get install <package name from dpkg -S command>

If it still doesn't work, try a different shell with no environment (to get rid of any wonky environment variables, setups, bash-specific junk, etc.):

env -i /bin/dash
$ who

If it works in a bare shell, then the problem is likely a weird alias definition in a bashrc, or something similar.

Also, does who --all work?

Felix
  • 161
  • 3