raspnode icon indicating copy to clipboard operation
raspnode copied to clipboard

Install fails on brand new Raspberry Pi due to logname failing

Open merehap opened this issue 7 years ago • 10 comments

Running "sudo ./raspnode.sh" fails on my system with the error message "logname: no login name", the same message that the logname command fails with. I worked around this with replacing logname in the script with $USER. Perhaps the script should use something other than logname, or have a fallback?

This is with Raspian running on a Raspberry Pi 3, Model B from CanaKit.

merehap avatar Mar 21 '18 01:03 merehap

If I change logname with $USER it returns me root as the script is launched with sudo.

logname works fine in my Raspberry with raspbian, it would be interesting to know if this problem is general or only occurs to you.

image

jochemin avatar Mar 21 '18 07:03 jochemin

Yeah, you're right it was returning root (that did allow things to proceed, but not really in the right way).

I think the problem is general to anyone using the same version of Raspberry Pi from the same company. That said, it is clearly a bug with the specific Raspberry Pi distro rather than your script, so maybe you'd still want to just close this issue if there is no clear workaround.

merehap avatar Mar 21 '18 23:03 merehap

Ok, so your distro was not raspbian?

jochemin avatar Mar 22 '18 06:03 jochemin

No, it is Raspbian. I'm just not sure why logname would be failing on a vanilla, unmodified install. When I said "distro" I just meant any modifications that CanaKit or others would have made to base Raspian that would cause logname to fail.

merehap avatar Mar 22 '18 07:03 merehap

In CanaKit web says they send an 8Gb microsd with NOOBS: image

jochemin avatar Mar 22 '18 07:03 jochemin

NOOBS just lets you choose which OSes you want to install. I only selected Raspbian from their menu.

merehap avatar Mar 22 '18 17:03 merehap

Ok, I would like to know if this problem is with Raspbian installed from NOOBS and occurs always.

If someone has run the script in a Raspbian installed from NOOBS please, comment.

jochemin avatar Mar 23 '18 07:03 jochemin

I had the same issue on Raspbian downloaded on official site https://www.raspberrypi.org/downloads/raspbian/ . I almost sure that it's the same image installed from NOOBS. I used a workaround and installed all like a charm ;) Thanks for your script, very useful!

Amiga500 avatar Mar 23 '18 15:03 Amiga500

I just created a bug on Raspbian's bug tracker for this: https://bugs.launchpad.net/raspbian/+bug/1758480

merehap avatar Mar 24 '18 01:03 merehap

I had the same issue on my Raspberry 3b. Within the script, I replaced $(logname) with $LOGNAME and that works.

developery-nl avatar Mar 28 '18 19:03 developery-nl