install-tl-ubuntu
install-tl-ubuntu copied to clipboard
logname: no login name
On Ubuntu 14.04.2,
sudo ./install-tl-ubuntu --hebrew --more-tex
results
logname: no login name
It is followed by another error (?) message a bit later:
sudo: unknown user:
sudo: unable to initialise policy plug-in
Any consequences I should be worried about..?
Thanks for this nicely formatted and clear report, pelegm. This part of the code is only used as a check that you did not have any non-standard setting of TeX Live environment variables. So my guess is that everything should be fine. If you have never installed TeX Live on this system before, I would replace "my guess is" with "I am quite confident" in the preceding statement.
However, I would appreciate your help in fixing this part of the code. Your system has more than one user, correct? How did you log in to your system before you ran the command sudo install-tl-ubuntu --hebrew --more-tex
? E.g. just through the normal Ubuntu GUI login? Or is this a headless server by chance?
What is the output of opening a terminal and running the following commands (you might need to paste them into your terminal one-by-one because for a few of them you need to put your password in)?
logname
echo "$USER"
sudo logname
sudo su
echo "$SUDO_USER"
whoami
who am i
logname
If you think the output from running the above commands might contain sensitive information, please email the output to me privately.
Hi,
First, I did have an aptitude version of texlive
, but hopefully I have purged it properly before running the script. Regarding your questions:
- I have only one user,
peleg
(excludingroot
of course) - I have logged in normally via Ubuntu's login screen (this is my personal laptop and I have a GUI installed)
And about the outputs of the commands:
peleg@lati::~$ logname
logname: no login name
peleg@lati::~$ echo "$USER"
peleg
peleg@lati::~$ sudo logname
logname: no login name
peleg@lati::~$ sudo su
root@lati:/home/peleg# echo "$SUDO_USER"
peleg
root@lati:/home/peleg# whoami
root
root@lati:/home/peleg# who am i
root@lati:/home/peleg# logname
logname: no login name
Now it looks like logname
does not work properly on my machine...
First, I did have an aptitude version of texlive, but hopefully I have purged it properly before running the script.
OK it should be fine then.
I have only one user
Ah then my next guess is that you use a default shell that is not bash. Is that correct?
In some sense it was silly of me to rely on that, but in another sense I was confident that the fallback (logname
) would work. However, that both fail shows that I had incorrect reasoning.
What is the output of the following?
grep "/bin/bash" /etc/passwd | perl -pe 's/.*\/(\w+):\/bin\/bash/$1/g' | grep -v "root"
I'm not sure why logname
does that for you. I don't know enough to say that it is incorrect behavior, just that I did not expect that. It is good to know that $SUDO_USER might be something I could rely on. I will have to test it in different situations though.
Hi, I am using bash
. The output of the command you've requested is
peleg
postgresql
I think that postgresql implementation is such that it creates a user account. So I believe that technically you have two non-root user accounts, in which case install-tl-ubuntu
correclty went to the fallback of using logname
. I suppose install-tl-ubuntu
could exclude "postgresql" from the results, but I think a better approach is to figure out why logname
does not work, and possibly use $SUDO_USER
.
I can't think of any other questions to ask you for now.
Thanks a lot for your help on this Peleg!
Unfortunately $LOGNAME does not work for me. To test, create a file test.sh
with the following contents:
#!/bin/bash
echo $LOGNAME
When I run sudo ./test.sh
, I get "root". When I replace echo $LOGNAME
with just the command logname
, I get "scott" when I run it.
Right.
However, echo $SUDO_USER does work here...
That is indeed looking like a good alternative.
Same issue here, similar output as @pelegm.
@smolkaj thanks for confirming and sorry for the frustration. I am hoping to have some time soon to fix this issue.