You are not logged in.

#1 2024-02-04 18:56:06

callmejoe
Member
Registered: 2019-03-06
Posts: 78

merging /etc/passwd.pacnew

I've already read the many threads on this recently, and fortunately I did not replace my /etc/passwd file with the pacnew file with the single line root:x:0:0::/root:/usr/bin/bash.   

I DID think about replacing it though, but after staring at it for 60 seconds I realized it can't be right, and just deleted the pacnew file.

The majority of pacnew files are usually a package's new full configuration file.  It's what I am used to seeing and I merge the changes.  If the program's devs decide to remove a bunch of lines from a new config file, I usually accept that and remove them from my config as well.  That's why it took me some time to think about this file.  For the /etc/passwd file the new config file isn't like a regular package's new config file.  It can't possibly have a set list of entries of course, like say /etc/bluetooth/main.conf.  So this is a pacnew file that needs to be handled differently.

Anyone have any thoughts on how to make users more aware of this so they don't end up with a non-working system?

Offline

#2 2024-02-04 19:27:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: merging /etc/passwd.pacnew

I really don't see the difference.  There is no simple heuristic or automagic way to handle .pacnew files - if there was, they wouldn't exist as pacman would just take the advisable action by itself.  Merging configs takes thought.  Look at the old, look at the new, understand what they do, and make informed choices.  This is the case for *every* pacnew file.

FWIW, removing anything from your config files that's not in the pacnew may have worked for you for other pacnew files - but not because it's a good idea, but rather that you've just been lucky.  Frankly that sounds like a very bad approach to me and I could give ample examples where it would result in significant breakage (not just passwd.pacnew).

New users should be made aware that they need to review pacnew files, and engage in a bit of thought.  If either of those steps are unacceptable, then arch is probably not a good choice for them.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2024-02-04 19:29:54

gugah
Member
Registered: 2013-01-02
Posts: 60

Re: merging /etc/passwd.pacnew

I DID think about replacing it though, but after staring at it for 60 seconds I realized it can't be right, and just deleted the pacnew file.

Aren't we supposed to modify the root line though? When I saw the diff it's clear I didn't want to delete the other entries, but I imagine devs requested the change to that line.

As for user warnings, I remember being this a while ago and I think it should be pinned so new users are aware: https://wiki.archlinux.org/title/system … the_system


"The problem with quotes on the Internet is that it is hard to verify their authenticity." ~ Abraham Lincoln

Offline

#4 2024-02-04 19:41:01

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: merging /etc/passwd.pacnew

From "https://archlinux.org/about/":

To summarize: Arch Linux is a versatile, and simple distribution designed to fit the needs of the competent Linux® user.

Everybody else (slight exaggeration) running Arch Linux *will* probably learn "it" the hard way burning their fingers, taking out the trash AND the bucket. A big part of Arch Linux is its documentation, where one would find:
https://wiki.archlinux.org/title/Pacman … pac*_files
and you're expected to read and learn (be competent) if you want to maintain AND enjoy an Arch Linux (DIY) system...

Last edited by dogknowsnx (2024-02-04 19:55:07)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#5 2024-02-04 19:44:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: merging /etc/passwd.pacnew

gugah wrote:

Aren't we supposed to modify the root line though?

Strictly speaking, yes / maybe.  But it's cosmetic change only.  Whether or not you make the change will have no effect at all.  And given that editing that file improperly could cause problems, I'd say on a whole it's best to just delete the passwd.pacnew and do nothing to your existing passwd file (though if you've already made the change, the same logic would support keeping it changed).

Last edited by Trilby (2024-02-04 19:46:03)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2024-02-04 19:48:38

callmejoe
Member
Registered: 2019-03-06
Posts: 78

Re: merging /etc/passwd.pacnew

Trilby wrote:

Look at the old, look at the new, understand what they do, and make informed choices.  This is the case for *every* pacnew file.

yes i agree here.  i can say that when i first started with arch a few years ago I would probably have replaced the file. today i know better.

FWIW, removing anything from your config files that's not in the pacnew may have worked for you for other pacnew files - but not because it's a good idea, but rather that you've just been lucky.  Frankly that sounds like a very bad approach to me and I could give ample examples where it would result in significant breakage (not just passwd.pacnew).

i leave the customization i've done, but will accept the new default changes presented in the pacnew file otherwise.  so far, so good.

Offline

#7 2024-02-04 19:53:01

callmejoe
Member
Registered: 2019-03-06
Posts: 78

Re: merging /etc/passwd.pacnew

dogknowsnx wrote:

Everybody else (slight exaggeration) running Arch Linux *will* probably learn "it" the hard way burning their fingers, taking out the trash AND the bucket.

yep. that is how i learned many lessons with arch.  and i dont mind that.  was thinking there might be a way reduce the number of future "burn" victims smile

Offline

#8 2024-02-04 20:21:50

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: merging /etc/passwd.pacnew

callmejoe wrote:

[...] reduce the number of future "burn" victims smile

I feel you - and we're only talking about a "simple" OS. The above metaphor is real, though...

EDIT: Also, consider this (happens all the time):

User one-click installs Arch derivative > user never gets to see a single pacman output (pacman wrapper) > user eventually decides they want the "real deal" > user installs arch (maybe even following a third party guide - no mention of the wiki. OK, in this case they still aren't running Arch Linux) > first thing user does is installing a pacman wrapper (habits) > nothing really changed...

Not much you can do about that.

Last edited by dogknowsnx (2024-02-05 08:36:39)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#9 2024-02-05 15:09:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,447

Re: merging /etc/passwd.pacnew

Mod note: Not an Arch discussion, moving to Packages & Upgrades

Offline

#10 2024-02-05 16:02:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: merging /etc/passwd.pacnew

callmejoe wrote:

i leave the customization i've done, but will accept the new default changes presented in the pacnew file otherwise.  so far, so good.

Yes, that is a good approach - and the exact same thinking can apply to the passwd.pacnew.  Just in this case the original content is trivial, and all the content of your /etc/passwd is what you've done.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2024-02-08 18:49:51

mountaintrek
Member
Registered: 2024-02-01
Posts: 38

Re: merging /etc/passwd.pacnew

I thought @Scimmia response was the best I've seen on the pacnew topic:

Scimmia wrote:

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

pacnew's are created because pacman detected the file has changed from the original  package (i.e., user customization/configuration). I can't imagine a scenario where a user would want to lose their changes.  The pacman option "-Qkk" will also show which files have changed.

Just make it a policy of NEVER replacing a file, always review & merge. After an update, I use "DIFFPROG=meld pacdiff".

I like the pacnew methodology because it gives me an opportunity to review my customizations, as well as learn about new options.  imho, that is one disadvantage to drop-in files.

Last edited by mountaintrek (2024-02-08 18:51:01)

Offline

#12 2024-02-08 19:30:11

callmejoe
Member
Registered: 2019-03-06
Posts: 78

Re: merging /etc/passwd.pacnew

ah now it has just clicked in for me,  really everything after the first line are my customizations.  I guess since I didn't manually add those lines I wasnt thinking of it that way.  now it makes sense  smile

Offline

#13 2024-02-10 11:51:28

Mizho
Member
Registered: 2021-06-23
Posts: 14

Re: merging /etc/passwd.pacnew

I searched this and fortunately found this thread. I just changed the first line however I noticed (according to https://wiki.archlinux.org/title/Users_ … ed_groups) there are unused groups such as bin, daemon, uuid, etc. Any thought on these? They are legacy users. I think some of them (if not used) are safe to be removed.

Moreover there is this warning in the wiki:

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 Mizho (2024-02-10 12:00:13)

Offline

#14 2024-02-10 15:10:44

loqs
Member
Registered: 2014-03-06
Posts: 18,133

Re: merging /etc/passwd.pacnew

Mizho wrote:

I searched this and fortunately found this thread. I just changed the first line however I noticed (according to https://wiki.archlinux.org/title/Users_ … ed_groups) there are unused groups such as bin, daemon, uuid, etc. Any thought on these? They are legacy users. I think some of them (if not used) are safe to be removed.

bin and daemon are created by /usr/lib/sysusers.d/arch.conf.  uuidd is created by /usr/lib/sysusers.d/util-linux.conf.

Offline

#15 2024-02-11 22:28:23

mountaintrek
Member
Registered: 2024-02-01
Posts: 38

Re: merging /etc/passwd.pacnew

Mizho wrote:

...there are unused groups such as bin, daemon, uuid, etc. Any thought on these? They are legacy users. I think some of them (if not used) are safe to be removed
...

There's more to it than just removing. They are managed by systemd now.  Since arch has them defined, I'd leave them alone.


Documentation on user and group management

Last edited by mountaintrek (2024-02-11 22:30:49)

Offline

Board footer

Powered by FluxBB