Bug 22993 - rpm --rebuilddb deletes but does not rebuid /var/lib/rpm/alternatives
Summary: rpm --rebuilddb deletes but does not rebuid /var/lib/rpm/alternatives
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: ---
Assignee: RPM stack maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-04 18:05 CEST by Frank Griffin
Modified: 2018-12-01 20:48 CET (History)
8 users (show)

See Also:
Source RPM: rpm
CVE:
Status comment:


Attachments

Description Frank Griffin 2018-05-04 18:05:40 CEST
As per subject line.  To reproduce, make a copy of /var/lib/rpm/alternatives and run "rpm --rebuilddb".  That directory will have been removed, breaking all existing alternatives symlinks and the "alternatives" command as well since the symlink from /var/lib/alternatives is now broken.

If the rebuilddb action (clearing the /var/lib/rpm directory) is correct, then /var/lib/rpm is probably not a good place for the alternatives admindir.
Marja Van Waes 2018-05-05 06:32:16 CEST

Assignee: bugsquad => rpmstack
CC: (none) => marja11

Comment 1 Shlomi Fish 2018-05-06 09:47:36 CEST
I can reproduce this here (mga 7 cauldron x86-64)/

CC: (none) => shlomif

Comment 2 Neal Gompa 2018-05-06 20:11:52 CEST
The alternatives directory should have been moved to /var/lib/alternatives in Mageia 6. We did that as part of the transition to chkconfig's implementation of alternatives...

CC: (none) => ngompa13

Comment 3 Frank Griffin 2018-05-07 01:43:15 CEST
/var/lib/alternatives exists, but it's a symlink to /var/lib/rpm/alternatives.
Comment 4 Stig-Ørjan Smelror 2018-05-26 21:53:50 CEST
I am also getting these messages when updating just now.

    11/21: gcc                   #################################################################
bad mode on line 1 of /var/lib/alternatives/gcc
bad mode on line 1 of /var/lib/alternatives/gcc-ar
bad mode on line 1 of /var/lib/alternatives/gcc-nm
bad mode on line 1 of /var/lib/alternatives/gcc-ranlib
    17/21: gcc-c++               #################################################################
bad mode on line 1 of /var/lib/alternatives/g++

CC: (none) => smelror

Comment 5 Pascal Terjan 2018-09-22 23:32:43 CEST
It hasn't moved, files live in /var/lib/rpm/alternatives with /var/lib/alternatives being a symlink http://svnweb.mageia.org/packages/cauldron/chkconfig/current/SPECS/chkconfig.spec ?view=markup&pathrev=1296121#l95 like it was in old package http://svnweb.mageia.org/packages/obsolete/update-alternatives/current/SPECS/update-alternatives.spec?revision=985854&view=markup

CC: (none) => pterjan

Comment 6 aguador 2018-09-23 09:18:13 CEST
(In reply to Pascal Terjan from comment #5)
> It hasn't moved, files live in /var/lib/rpm/alternatives with
> /var/lib/alternatives being a symlink
> http://svnweb.mageia.org/packages/cauldron/chkconfig/current/SPECS/chkconfig.
> spec ?view=markup&pathrev=1296121#l95 like it was in old package
> http://svnweb.mageia.org/packages/obsolete/update-alternatives/current/SPECS/
> update-alternatives.spec?revision=985854&view=markup

I see that in the SPEC, but chkconfig created this for me:

/var/lib/alternatives/alternatives/alternatives/alternatives/alternatives/alternatives/alternatives/alternatives/

CC: (none) => waterbearer54

Comment 7 Neal Gompa 2018-09-23 13:51:39 CEST
The reason we're supposed to have moved it is because rpm's --rebuilddb implementation changed.

It now regenerates the /var/lib/rpm directory, which means it's a really bad idea to put other things in there.
Comment 8 Thomas Backlund 2018-09-23 14:25:54 CEST
wich means chkconfig package is  broken then...

in pre on upgrade it should  check for /var/lib/alternatives symlink, nuke it, check for /var/lib/rpm/alternatives dir, move it to /var/lib/alternatives  and add a symlink in rpm/alternatives to keep upgrade path until all packages depending on the location is installed...

after that no-one should need to care about if/when the rpm/alternatives symlink gets nuked.

CC: (none) => tmb

Comment 9 Dave Hodgins 2018-09-30 20:01:04 CEST
Marking this bug as a release blocker for Mageia 7.

Severity: major => critical
CC: (none) => davidwhodgins
Priority: Normal => release_blocker

Comment 10 Thomas Backlund 2018-12-01 20:48:10 CET
Should now be fixed by wally in  chkconfig-1.10-3.mga7

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.