Off-Topic: ${LOGNAME} vs. ${USER}
silver.bullet at zoho.com
silver.bullet at zoho.com
Fri Jul 31 11:31:27 UTC 2015
On Fri, 31 Jul 2015 02:56:16 -0400 Tom H wrote:
> I don't use Arch but I suspect from the above output that its
> "/bin/su" is provided by "util-linux", like Fedora/RHEL, rather than
> by "login", which is derived from the "shadow" source package.
>
> For util-linux
> $HOME, $SHELL
> are reset
> and
> $LOGNAME, $USER
> are reset if the target user is not root
>
> For login/shadow
> $HOME, $LOGNAME, $PATH, $SHELL, $USER
> are reset
>
> AFAIR, in the util-linux case, $PATH used to behave like $LOGNAME and
> $USER but it's no longer reset (but there's a login.defs variable for
> it to be reset).
Thank you Tom,
it's useful to know such things, to keep scripts compatible for usage
with different Linux distros and operating systems.
Your guess is correct.
[rocketmouse at archlinux ~]$ pacman -Qo /usr/bin/su
/usr/bin/su is owned by util-linux 2.26.2-1
Regards,
Ralf
PS:
FHS Ubuntu
[rocketmouse at archlinux ~]$ p="/mnt/moonstudio"
[rocketmouse at archlinux ~]$ ls -hAld $p/bin $p/sbin $p/usr/bin/
$p/usr/sbin
drwxr-xr-x 2 root root 4.0K Jul 26 15:48 /mnt/moonstudio/bin
drwxr-xr-x 2 root root 4.0K Jul 30 14:38 /mnt/moonstudio/sbin
drwxr-xr-x 2 root root 36K Jul 31 10:26 /mnt/moonstudio/usr/bin/
drwxr-xr-x 2 root root 4.0K Jul 31 10:25 /mnt/moonstudio/usr/sbin
FHS Arch
[rocketmouse at archlinux ~]$ p=""
[rocketmouse at archlinux ~]$ ls -hAld $p/bin $p/sbin $p/usr/bin/
$p/usr/sbin
lrwxrwxrwx 1 root root 7 Apr 22 17:51 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 Apr 22 17:54 /sbin -> usr/bin
drwxr-xr-x 5 root root 212K Jul 30 16:28 /usr/bin/
lrwxrwxrwx 1 root root 3 Apr 22 17:57 /usr/sbin -> bin
I noticed that by default Ubuntu's /tmp isn't tmpfs
[rocketmouse at archlinux ~]$ ls -a /mnt/moonstudio/tmp/
. .spamassassin102421p50xJtmp .spamassassin10242DBmUqjtmp .spamassassin10242XZLXCitmp
.. .spamassassin102424Cvbvktmp .spamassassin10242edxaWAtmp .spamassassin10242zKWRtntmp
config-err-SL5T3l .spamassassin102424d72xatmp .spamassassin10242FWYa7xtmp .Test-unix
.font-unix .spamassassin102424IF1kitmp .spamassassin10242mRPxB3tmp .X11-unix
.ICE-unix .spamassassin10242cLW8dJtmp .spamassassin10242oi0hf7tmp .XIM-unix
qupzilla-weremouse .spamassassin10242CwrMp8tmp .spamassassin10242w4NwR9tmp
Default for Arch is tmpfs
[rocketmouse at archlinux ~]$ df | grep /tmp
tmpfs 1895600 112 1895488 1% /tmp
More information about the ubuntu-users
mailing list