Bug 1379030 - Broken %postun scriptlet
Summary: Broken %postun scriptlet
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
: 1379117 1379344 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2016-09-24 04:01 UTC by Mattias Ellert
Modified: 2016-11-19 10:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-11-19 10:11:07 UTC
Type: Bug

Attachments (Terms of Use)

Description Mattias Ellert 2016-09-24 04:01:13 UTC
Description of problem:

Running transaction
  Reinstalling: binutils-2.27-8.fc26.x86_64                                 1/2 
  Erasing     : binutils-2.27-8.fc26.x86_64                                 2/2 
/sbin/ldconfig: relative path `1' used to build cache
warning: %postun(binutils-2.27-8.fc26.x86_64) scriptlet failed, exit status 1
Non-fatal POSTUN scriptlet failure in rpm package binutils
Non-fatal POSTUN scriptlet failure in rpm package binutils
  Verifying   : binutils-2.27-8.fc26.x86_64                                 1/2 
  Verifying   : binutils-2.27-8.fc26.x86_64                                 2/2 

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

How reproducible:

Steps to Reproduce:
1. dnf reinstall binutils

Actual results:
Errors during package upgrade

Expected results:
No errors

Additional info:


%postun -p /sbin/ldconfig

should say:

Comment 1 Nick Clifton 2016-09-26 08:47:03 UTC
*** Bug 1379117 has been marked as a duplicate of this bug. ***

Comment 2 Jakub Jelinek 2016-09-26 08:54:12 UTC
says %postun -p /sbin/ldconfig
is recommended.  So, either the packaging guidelines are incorrect and should be fixed (and tons of packages that do this), or rpm just shouldn't pass any arguments to scriptlets with -p /sbin/ldconfig

Comment 3 Mattias Ellert 2016-09-26 09:33:11 UTC
You are right that %postun -p /sbin/ldconfig is recommended if the only thing you are doing in the scriptlet is calling /sbin/ldconfig. This is not the case here.

The %post scriptlet, which also calls /sbin/ldconfig in addition to having a lot of other lines of shell script does it correctly:


Using -p /sbin/ldconfig with a non-empty scriptlet containing shell code is equivalent to trying to run

#! /sbin/ldconfig
<scriptlet code goes here>

I.e. you are telling rpm to try to tell the /sbin/ldconfig binary to interpret shell script code, which fails miserably.

%postun without a -p option is equivalent to the default %postun -p /bin/bash, i.e. what is run is

#! /bin/bash
<scriptlet code goes here>

If you are only calling /sbin/ldconfig it is more efficient to use -p /sbin/ldconfig with an empty scriptlet, since you then skip the shell invocation. But if there are other things that you want to do in the scriptlet in addition to the call to /sbin/ldconfig you need it.

Comment 4 Nick Clifton 2016-09-26 11:51:59 UTC
Should be fixed in: binutils-2.27-9.fc26

Comment 5 Nick Clifton 2016-09-26 13:03:46 UTC
*** Bug 1379344 has been marked as a duplicate of this bug. ***

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