You are not logged in.
I have just run pacman -Syu, and one update,
filesystem 2023.09.18-1 -> 2024.01.19-1
generated the message:
warning: /etc/passwd installed as /etc/passwd.pacnew
The passwd.pacnew has ony one line:
root:x:0:0::/root:/usr/bin/bash
but the old passwd was
root:x:0:0::/root:/bin/bash
bin:x:1:1::/:/usr/bin/nologin
daemon:x:2:2::/:/usr/bin/nologin
mail:x:8:12::/var/spool/mail:/usr/bin/nologin
ftp:x:14:11::/srv/ftp:/usr/bin/nologin
http:x:33:33::/srv/http:/usr/bin/nologin
nobody:x:65534:65534:Nobody:/:/usr/bin/nologin
dbus:x:81:81:System Message Bus:/:/usr/bin/nologin
systemd-coredump:x:981:981:systemd Core Dumper:/:/usr/bin/nologin
systemd-network:x:980:980:systemd Network Management:/:/usr/bin/nologin
systemd-oom:x:979:979:systemd Userspace OOM Killer:/:/usr/bin/nologin
systemd-journal-remote:x:978:978:systemd Journal Remote:/:/usr/bin/nologin
systemd-resolve:x:977:977:systemd Resolver:/:/usr/bin/nologin
systemd-timesync:x:976:976:systemd Time Synchronization:/:/usr/bin/nologin
tss:x:975:975:tss user for tpm2:/:/usr/bin/nologin
uuidd:x:68:68::/:/usr/bin/nologin
dhcpcd:x:974:974:dhcpcd privilege separation:/:/usr/bin/nologin
andy:x:1000:1000::/home/andy:/bin/bash
avahi:x:973:973:Avahi mDNS/DNS-SD daemon:/:/usr/bin/nologin
colord:x:972:972:Color management daemon:/var/lib/colord:/usr/bin/nologin
polkitd:x:102:102:PolicyKit daemon:/:/usr/bin/nologin
usbmux:x:140:140:usbmux user:/:/usr/bin/nologin
lightdm:x:971:971:Light Display Manager:/var/lib/lightdm:/usr/bin/nologin
cups:x:209:209:cups helper user:/:/usr/bin/nologin
git:x:970:970:git daemon user:/:/usr/bin/git-shell
saned:x:969:969:SANE daemon user:/:/usr/bin/nologin
sddm:x:967:967:Simple Desktop Display Manager:/var/lib/sddm:/usr/bin/nologin
geoclue:x:966:966:Geoinformation service:/var/lib/geoclue:/usr/bin/nologin
systemd-journal-upload:x:965:965:systemd Journal Upload:/:/usr/bin/nologin
rtkit:x:133:133:RealtimeKit:/proc:/usr/bin/nologin
Is this correct? Will the other "users" lose access?
Last edited by Flapper (2024-01-29 08:47:24)
Offline
It's correct that you're supposed to merge changes. https://gitlab.archlinux.org/archlinux/ … 0d4d8effd4 . YOU NEVER JUST REPLACE the file with the .pacnew file.
Realistically, you usually ignore pacnew files for /etc/passwd
Offline
It's correct that you're supposed to merge changes. https://gitlab.archlinux.org/archlinux/ … 0d4d8effd4 . YOU NEVER JUST REPLACE the file with the .pacnew file.
Realistically, you usually ignore pacnew files for /etc/passwd
Could you elaborate a bit?
In my case, I learned that I should be careful with passwd (the hard way).
The change
from
root:x:0:0::/root:/bin/bash
to
root:x:0:0::/root:/usr/bin/bash
Is that a new policy Arch devs made?
And for example.
For my user there is a line:
jm:x:1000:1000::/home/jm:/bin/bash
So should I change it to
jm:x:1000:1000::/home/jm:/usr/bin/bash
?
I've checked and it seems that only users (root and jm) don't use /usr/bin/bash
cat /etc/passwd | grep -v "/usr/"
root:x:0:0::/root:/bin/bash
jm:x:1000:1000::/home/jm:/bin/bash
p.s.
In /etc/ there is a file passwd-
What is that?
Last edited by 860lacov (2024-01-22 23:06:22)
Offline
For my user there is a line:
jm:x:1000:1000::/home/jm:/bin/bash
So should I change it to
jm:x:1000:1000::/home/jm:/usr/bin/bash
?
I've checked and it seems that only users (root and jm) don't use /usr/bin/bash
According to Package Contents of bash:
[...]
usr/
usr/bin/
usr/bin/bash
usr/bin/bashbug
usr/bin/rbash
usr/bin/sh
[...]
Last edited by d.ALT (2024-01-23 07:05:00)
<49,17,III,I> Fama di loro il mondo esser non lassa;
<50,17,III,I> misericordia e giustizia li sdegna:
<51,17,III,I> non ragioniam di lor, ma guarda e passa.
Offline
The files that the bash package is providing are not sufficient.
Is that a new policy Arch devs made?
No. After the so-called /usr-move, /bin is usually linked to /usr/bin anyways.
Most importantly, your shell's full path must be listed in /etc/shells for it to work properly.
In /etc/ there is a file passwd-
What is that?
It's a backup file for /etc/passwd.
tl;dr
You can ignore /etc/passwd.pacnew and/or remove it when invoking pacdiff.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
I'm going to wildly speculate that the change from /bin/bash to /usr/bin/bash is motivated by the dropping of support for separate /usr/ partitions by the most recent version of systemd. As mentioned /bin/bash is a symlink to /usr/bin/bash so either will work just fine, both are added to /etc/shells by the bash.install script supplied by the bash package.
Jin, Jîyan, Azadî
Offline
I'm going to wildly speculate that the change from /bin/bash to /usr/bin/bash is motivated by the dropping of support for separate /usr/ partitions by the most recent version of systemd.
Baseless speculation.
The reason for the change is very simple: /bin/bash looks and feels wrong.
After /usr/bin/bash was added to /etc/shells (and it only took a decade), both /etc/default/useradd and the default /etc/passwd could finally be updated.
Since it hasn't been mentioned, https://wiki.archlinux.org/title/Users_ … r_database has instructions for situations where there's a /etc/passwd.pacnew:
Warning: Arch Linux defaults of the files are created as pacnew files by new releases of the filesystem package. Unless Pacman outputs related messages for action, these .pacnew files can, and should, be disregarded/removed. New required default users and groups are added or re-added as needed by systemd-sysusers(8) or the package install script.
Last edited by nl6720 (2024-01-23 09:32:46)
Offline
The reason for the change is very simple: /bin/bash looks and feels wrong.
I don't think I've seen /usr/bin/bash much outside of ArchLinux. It nearly doesn't exist at all.
Shellscripts (and everything else) still quite dominantly refer to /bin paths.
$ head -n 1 /usr/bin/* | grep -aP '^#!' | sort | uniq -c | sort -rn
396 #!/bin/sh
90 #!/usr/bin/python
77 #! /bin/sh
52 #!/usr/bin/perl
48 #!/usr/bin/env python3
39 #!/bin/bash
23 #!/usr/bin/python3
23 #!/usr/bin/env bash
16 #!/usr/bin/env perl
15 #!/usr/bin/perl -w
9 #!/bin/sh -f
8 #!/usr/bin/python3.11
7 #!/usr/bin/bash
...
/bin/sh wins by a huge margin, /bin/bash is common, /usr/bin/env bash less common, /usr/bin/bash nearly doesn't exist at all - the 7 matches for /usr/bin/bash are nearly all pacman scripts. makepkg, pacman-db-upgrade, pacman-key, repo-add, repo-remove, ... so it's completely ArchLinux specific.
Adding a user with $(which bash) seems to be a constructed example. It's longer to type than either /bin/bash or /usr/bin/bash ... and it could prefer /usr/local/bin over /usr/bin ... leading to unexpected results. So it's wrong to use $(which) in useradd...
It's both the same thing either way.
Last edited by frostschutz (2024-01-23 10:08:00)
Offline
Many Linux distros have made the so-called /usr-move.
The issue in /etc/passwd is that the user's shell needs to be registered in /etc/shells.
It does not matter what path shell scripts use, as long as there is the symlink /bin to /usr/bin for backwards compatibility.
Last edited by schard (2024-01-23 10:12:55)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
I wasn't sure and just deleted the one line in the old /etc/passwd
root:x:0:0::/root:/bin/bash
and copied and pasted the new line from the .pacnew in the /etc/passwd
root:x:0:0::/root:/usr/bin/bash
.
I hope this was okay.
Last edited by micronetic (2024-01-26 09:55:00)
Offline
What one line? Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
So it's wrong to use $(which) in useradd...
Online
Action
I've replaced /bin/bash for user root by /usr/bin/bash in the existing /etc/passwd. All other users had already either /usr/bin/bash or /usr/bin/nologin.
Rationale
I want it tidy.
Recommendation
Comply with the instructions by Scimmia. A manual merge isn't necessary, and it is safe to ignore the pacnew. The warning in the wiki mentioned by nl2670 also recommends acting only when Pacman requires it.
Last edited by hoschi (2024-01-27 20:51:19)
Offline
It's fun to see alleged "baseless speculation" confronted with vague and completely subjective assertions of something "feeling wrong" to one individual wiki admin. Personally I subjectively find /usr/bin/bash ugly, redundant, excessively long, etc. All bash scripts I write use #!/bin/bash as the shebang. They'll work on any system that links /usr/bin to /bin ... and they'll work on any systems that don't. If you specify #!/usr/bin/bash you are limiting portability for no benefit whatsoever. But hey, if that "looks and feels" right to you, you do you - but perhaps reserve the tone of superiority to when you have more than your gut feeling.
Last edited by Trilby (2024-01-27 19:36:26)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
https://en.wikipedia.org/wiki/Filesyste … _structure
Edit: to add some facts to a feelings-driven conversation.
/bin/bash is the canonical path, the /usr move didn't change anything about that.
It's cool to have /usr/bin and /bin the same and it's perfectly fine to set /usr/bin/zsh as one's loginshell, but the canonical, traditional, and predominant path is /bin/bash and if you unsymlink /bin from /usr/bin, your system will fall apart. So in doubt don't get creative about that.
Last edited by seth (2024-01-27 20:40:29)
Online
The FHS doesn't really apply to Arch because it uses systemd so file-hierarchy(7) is the reference and that specifies /bin/ as a compatibility symlink. Having said that, I do agree with seth & Trilby's posts above entirely.
And I think my baseless speculation offered a better rationale than that provided by our Beloved Wiki Admin
Jin, Jîyan, Azadî
Offline
I actually had a snarky comment about lennart breaking the FHS, then breaking it again and whining to not blame him because it was already broken but figured I had exceeded my lennart-trashing quota for this week already
Even though arch/systemd no longer follows the FHS, that in this case only means that /bin/bash and /usr/bin/bash are interchangeable, just like "pacman -Syu" and pacman "-Suy". Still, there's a clear and obvious answer which version is to be preferred
Online
I ran `pacdiff -s` today and saw that change of `/bin/bash` to `/usr/bin/bash` then carelessly did a `dp` in vim to merge that change then exited before noticing it pushed the entire file. Doh! So I ended up with `/etc/passwd` with only a single root line. Luckily something on Arch must maintain a `/etc/passwd-` backup which I found and restored. Did a `cut` and `comm` with `/etc/shadow` and found I was missing only 1 user line which I recovered by re-installing the associated package.
In short, be careful editing/merging your `/etc/passwd`!
Offline
I was just explaining my motivation for creating FS#79768 and archlinux/packaging/packages/filesystem!3 which led to this change.
If that's not satisfactory, everyone is free to continue making up elaborate reasons for why this change was made.
Edit: Mind that I can't answer why my bug report and merge request was accepted by the package maintainer. Their motivation may differ from mine.
Last edited by nl6720 (2024-01-28 11:23:36)
Offline
Well, I really set the cat among the pigeons here..
I just took Scimmia's advice in #2.
Should I mark this as solved?
Offline
Yes. You got an answer, applied it and your problem is solved.
Don't worry too much about the other stuff.
Pointless argues about whether /bin/bash or /usr/bin/bash is correct when both reference the same inode is what nerds do
Online