Beware the Ides of etc-update! -Mandriva

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Beware the Ides of etc-update! -Mandriva

Postby rolf » 28 Jun 2012, 18:04

This is just a short tale illuminating one potential pitfall of system administration. Backstory:
  • The arrival of 2011 on this machine was attended by much pain.
  • There has been a sort of occasional malaise when I try to install or uninstall with package management
  • and now, for the life of me, I can't get glx to load for the proprietary dkms-nvidia driver, even though it works in the same machine on Bernie Lomax and Rosa 2012ltd. :f

Daily growing closer to the conclusion that reinstalling is the only solution, I thought of the widely used practice to package new default configurations as .rpmnew files in updates. Google showed some info, including helpful bash way to find them: find / -print | egrep "rpmnew$|rpmsave$" and the actual mandriva script for making it easy, etc-update

So, feeling resigned to "nothing to lose", I ran etc-update, which presented two .rpmnew files, one at a time, with some choices, similar to:

GENTOO Wiki wrote:Run the command etc-update
You'll see a list of changed config files. For each file, you can:
  1. Use the whole .rpmnew file as the working file
  2. Merge the update
  3. Discard the update
  4. Partially (interactively) merge the update
  5. Ignore the update
    and I'll add one I saw in terminal
  6. Quit etc-update


My two files were /etc/passwd and /etc/groups and BAM!, I chose #1 for each. Next, I opened a new terminal tab and, instead of the normal bash prompt, there were excited warnings and a new prompt:

Code: Select all

I have no name!I have no name!
I have no name!
[I have no name!@localhost]$


Also, something about uid 501 (my uid) having no user. First, I tried to su to root but the root password was not recognized. Then, since it was lucky I already had a root login on the tab where I ran etc-update,

Code: Select all

[root@localhost rolf]# usermod -u 501 rolf


The news, here, was user rolf did not exist. Finally, I noticed etc-update had made /etc/passwd- and /etc/group- backups.
So, next try was to

Code: Select all

[root@localhost rolf]# cp /etc/passwd /etc/passwd.f*ck
[root@localhost rolf]# cp /etc/passwd- /etc/passwd


Being careful not to discard anything, with a vowel who shall remain nameless in place of *.
At this point, I had my user prompt back in new shells but there was a problem with my group id, so

Code: Select all

[root@localhost rolf]# cp /etc/group /etc/group.f*ck
[root@localhost rolf]# cp /etc/group- /etc/group


and, bingo-bango, all is back as it was, afaict. So, while this is not guru-level information and there have got to be better-informed ways of dealing with .rpmnew files, beware the ides of etc-update, gentle grasshopper!

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Beware the Ides of etc-update! -Mandriva

Postby viking60 » 28 Jun 2012, 20:42

Good find - I think I have heard about others having such a problem too.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Beware the Ides of etc-update! -Mandriva

Postby dedanna1029 » 28 Jun 2012, 22:12

So that's what that was... thanks. I just gave up.and threw Mint back on. Needed it to work, wasn't interested in fixing.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html


Return to “Tips & Tricks”