Bug 18218

Summary: 6_s1: lp.1.gz lpc.8.gz lpq.1.gz lpr.1.gz lprm.1.gz dangling links
Product: Mageia Reporter: Bit Twister <bittwister2>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: release_blocker CC: eatdirt, luigiwalser, marja11, pterjan
Version: Cauldron   
Target Milestone: Mageia 6   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: foomatic-db-engine CVE:
Status comment:

Description Bit Twister 2016-04-17 09:41:55 CEST
Description of problem:

The following are the dangling links: 
/usr/share/man/man1/lp.1.gz -> /etc/alternatives/print-lpman 
/usr/share/man/man8/lpc.8.gz -> /etc/alternatives/print-lpcman 
/usr/share/man/man1/lpq.1.gz -> /etc/alternatives/print-lpqman 
/usr/share/man/man1/lpr.1.gz -> /etc/alternatives/print-lprman 
/usr/share/man/man1/lprm.1.gz -> /etc/alternatives/print-lprmman 

/etc/alternatives/print-cancelman -> /usr/share/man/man1/cancel-cups.1.gz 
/etc/alternatives/print-lpcman -> /usr/share/man/man8/lpc-cups.8.gz 
/etc/alternatives/print-lpman -> /usr/share/man/man1/lp-cups.1.gz 
/etc/alternatives/print-lpqman -> /usr/share/man/man1/lpq-cups.1.gz 
/etc/alternatives/print-lprman -> /usr/share/man/man1/lpr-cups.1.gz 
/etc/alternatives/print-lprmman -> /usr/share/man/man1/lprm-cups.1.gz 
/etc/alternatives/print-lpstatman -> /usr/share/man/man1/lpstat-cups.1.gz 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Clean install of Mageia-6-dev1-x86_64-DVD.iso 
   with enabled non-free and tainted media plus updates.
7. click up a terminal
8. urpmi task-printing-hp
9. su - root
10. urpmi symlinks
11. symlinks -r / | grep dangling
Comment 1 Rémi Verschelde 2016-04-17 11:07:44 CEST
Assigning to packagers collectively as ucarp has no registered maintainer.

Assignee: bugsquad => pkg-bugs

Comment 2 Bit Twister 2016-04-17 12:04:49 CEST
How about the foomatic-db-engine rpm this was opened against?  :)
Comment 3 Rémi Verschelde 2016-04-17 12:34:11 CEST
Copy paste mistake, but foomatic-db-engine also has no maintainer.

$ mgarepo maintdb get foomatic-db-engine
nobody
Bit Twister 2016-07-06 22:43:28 CEST

Summary: 6_d1: lp.1.gz lpc.8.gz lpq.1.gz lpr.1.gz lprm.1.gz dangling links => 6_s1: lp.1.gz lpc.8.gz lpq.1.gz lpr.1.gz lprm.1.gz dangling links

Comment 4 Chris Denice 2016-07-28 10:08:41 CEST
Confirmed!
If is even more dramatic, the binaries are screwed too. There is no longer any working "lpr" command


/etc/alternatives/lpr -> /usr/bin/lpr-cups

while the binary is:

/usr/bin/lpr.cups

Switched to rel crit.

CC: (none) => eatdirt
Priority: Normal => release_blocker
Target Milestone: --- => Mageia 6

Marja Van Waes 2016-07-28 11:04:06 CEST

CC: (none) => marja11
Blocks: (none) => 15527

Comment 5 David Walser 2016-08-10 00:14:58 CEST
This comes from the cups package, not foomatic-db-engine.

Assignee: pkg-bugs => thierry.vignaud
Source RPM: foomatic-db-engine-4.0.12-1.20150819.1.mga6.src.rpm => cups-2.1.4-1.mga6.src.rpm
CC: (none) => luigiwalser

Comment 6 Pascal Terjan 2016-09-08 02:12:44 CEST
This is working fine here, and the scriptlets are there as expected:

$ rpm -q --scripts cups-common
postinstall scriptlet (using /bin/sh):
# Set up update-alternatives entries
/usr/sbin/alternatives --install /usr/bin/lpr print /usr/bin/lpr.cups 40 \
	 --slave /usr/bin/lp print-lp /usr/bin/lp.cups \
	 --slave /usr/bin/lpq print-lpq /usr/bin/lpq.cups \
	 --slave /usr/bin/lprm print-lprm /usr/bin/lprm.cups \
	 --slave /usr/bin/lpstat print-lpstat /usr/bin/lpstat.cups \
	 --slave /usr/bin/cancel print-cancel /usr/bin/cancel.cups \
	 --slave /usr/sbin/lpc print-lpc /usr/sbin/lpc.cups \
	 --slave /usr/share/man/man1/cancel.1.gz print-cancelman /usr/share/man/man1/cancel-cups.1.gz \
	 --slave /usr/share/man/man1/lp.1.gz print-lpman /usr/share/man/man1/lp-cups.1.gz \
	 --slave /usr/share/man/man8/lpc.8.gz print-lpcman /usr/share/man/man8/lpc-cups.8.gz \
	 --slave /usr/share/man/man1/lpq.1.gz print-lpqman /usr/share/man/man1/lpq-cups.1.gz \
	 --slave /usr/share/man/man1/lpr.1.gz print-lprman /usr/share/man/man1/lpr-cups.1.gz \
	 --slave /usr/share/man/man1/lprm.1.gz print-lprmman /usr/share/man/man1/lprm-cups.1.gz \
	 --slave /usr/share/man/man1/lpstat.1.gz print-lpstatman /usr/share/man/man1/lpstat-cups.1.gz
exit 0

preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ] ; then
	/usr/sbin/alternatives --remove print /usr/bin/lpr.cups
fi
exit 0

$ /usr/sbin/alternatives --display print
print - status is auto.
 link currently points to /usr/bin/lpr.cups
/usr/bin/lpr.cups - priority 40
 slave print-cancel: /usr/bin/cancel.cups
 slave print-lp: /usr/bin/lp.cups
 slave print-lpq: /usr/bin/lpq.cups
 slave print-lprm: /usr/bin/lprm.cups
 slave print-lpstat: /usr/bin/lpstat.cups
 slave print-lpc: /usr/sbin/lpc.cups
 slave print-cancelman: /usr/share/man/man1/cancel-cups.1.gz
 slave print-lpman: /usr/share/man/man1/lp-cups.1.gz
 slave print-lpqman: /usr/share/man/man1/lpq-cups.1.gz
 slave print-lprman: /usr/share/man/man1/lpr-cups.1.gz
 slave print-lprmman: /usr/share/man/man1/lprm-cups.1.gz
 slave print-lpstatman: /usr/share/man/man1/lpstat-cups.1.gz
 slave print-lpcman: /usr/share/man/man8/lpc-cups.8.gz
Current `best' version is /usr/bin/lpr.cups.

What do "/usr/sbin/alternatives --display print" give on broken systems?

CC: (none) => pterjan

Comment 7 Pascal Terjan 2016-09-08 02:22:35 CEST
I just tried urpme cups-common + urpmi task-printing-hp and everything was removed/added correctly
Comment 8 Bit Twister 2016-09-08 02:38:07 CEST
(In reply to Pascal Terjan from comment #7)
> I just tried urpme cups-common + urpmi task-printing-hp and everything was
> removed/added correctly

Hmm, I am surprised task-printing-hp worked which installed the  foomatic-db-engine- package I created the bug report against. luigiwalser changed it to cups.

I can not provide any more information. Anytime I do an install/update my scripts test for dangling links. Once I report the dangles, I delete them.

I assume cups was installed and I had no dangles when I did the task-printing-hp package install. After install I had the above dangles.

I heard a rumor Mageia-6-sta2-x86_64-DVD.iso might be released fairly soon so I guess I'll see if the dangles show up again. Feel free to do whatever with this bug report as you see fit.
Comment 9 David Walser 2016-09-08 02:44:46 CEST
I changed it to cups, because cups is the source of the links in question.  foomatic-db-engine has nothing to do with yhis bug.
Comment 10 Pascal Terjan 2016-09-08 02:48:34 CEST
You are right, there is a problem with foomatic-db-engine as it creates different alternatives providing some of the same links:

postinstall scriptlet (using /bin/sh):
# Set up update-alternatives entries
/usr/sbin/update-alternatives --install /usr/bin/lpr lpr /usr/bin/lpr-foomatic 1
/usr/sbin/update-alternatives --install /usr/bin/lpq lpq /usr/bin/lpq-foomatic 1
/usr/sbin/update-alternatives --install /usr/bin/lprm lprm /usr/bin/lprm-foomatic 1
/usr/sbin/update-alternatives --install /usr/sbin/lpc lpc /usr/sbin/lpc-foomatic 1
preuninstall scriptlet (using /bin/sh):
if [ "$1" -eq "0" ]; then
  # On removal
  # Remove update-alternatives entries
  /usr/sbin/update-alternatives --remove lpr /usr/bin/lpr-foomatic
  /usr/sbin/update-alternatives --remove lpq /usr/bin/lpq-foomatic
  /usr/sbin/update-alternatives --remove lprm /usr/bin/lprm-foomatic
  /usr/sbin/update-alternatives --remove lpc /usr/sbin/lpc-foomatic
fi
Pascal Terjan 2016-09-08 02:48:48 CEST

Source RPM: cups-2.1.4-1.mga6.src.rpm => foomatic-db-engine

Comment 11 David Walser 2016-09-08 02:54:11 CEST
None of the links referenced in Comment 0 come from foomatic-db-engine.
Comment 12 Pascal Terjan 2016-09-08 02:57:42 CEST
Yes, I am not sure why other links get broken, possibly a bug in update-alternatives when one with slaves get overwritten
Comment 13 Pascal Terjan 2016-09-08 03:16:32 CEST
This should be fixed.

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

Samuel Verschelde 2017-01-17 10:29:39 CET

Blocks: 15527 => (none)