Bug 1017493 - postinstall, postuninstall, preuninstall scriptlets broken
postinstall, postuninstall, preuninstall scriptlets broken
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: usbmuxd (Show other bugs)
19
Unspecified Unspecified
unspecified Severity urgent
: ---
: ---
Assigned To: Ralf Corsepius
Fedora Extras Quality Assurance
: Reopened
: 1018119 1018418 1022420 1028824 1031507 (view as bug list)
Depends On:
Blocks: 1018118
  Show dependency treegraph
 
Reported: 2013-10-09 23:16 EDT by Ralf Corsepius
Modified: 2013-11-18 04:59 EST (History)
11 users (show)

See Also:
Fixed In Version: usbmuxd-1.0.8-10.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-14 03:09:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed fix (967 bytes, patch)
2013-10-10 00:51 EDT, Ralf Corsepius
no flags Details | Diff
how manual did you have to get for the packaging remove? (4.03 KB, text/plain)
2013-10-12 00:44 EDT, collura
no flags Details

  None (edit)
Description Ralf Corsepius 2013-10-09 23:16:38 EDT
Description of problem:

The postinstall, postuninstall, preuninstall scriptlets in all current usbmuxd-rpms for Fedora >= 20 are broken.

# rpm -q --scripts -p development/20/x86_64/os/Packages/u/usbmuxd-1.0.8-8.fc20.x86_64.rpm 
...
postinstall scriptlet (using /bin/sh):
/sbin/ldconfig
%systemd_post usbmuxd.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun usbmuxd.service

%postun/
sbin/ldconfig
%systemd_postun_with_restart usbmuxd.service

Version-Release number of selected component (if applicable):
usbmuxd-1.0.8-8.fc20
usbmuxd-1.0.8-9.fc20


=> The rpms carry unexpanded systemd macros.


Additional info:
These unexpanded systemd macros cause yum update failures, leaving behind duplicate entries in rpmdb.
Comment 1 Ralf Corsepius 2013-10-09 23:46:19 EDT
I just realized, the macro expansion issue seems to be fixed in
usbmuxd-1.0.8-9.fc20, with mess the unexpanded macros had caused having confused me. 

However, there is another scriptlet bug in usbmuxd %post which added to the confusion in attempts to cleanup the earlier issus.
I am closing this bug and will submit another one.
Comment 2 Ralf Corsepius 2013-10-10 00:10:35 EDT
I have to correct myself.

This bug is not fixed:

$ rpm -q --scripts -p usbmuxd-1.0.8-9.fc20.i686.rpm
warning: usbmuxd-1.0.8-9.fc20.i686.rpm: Header V3 RSA/SHA256 Signature, key ID 246110c1: NOKEY
preinstall scriptlet (using /bin/sh):
getent group usbmuxd >/dev/null || groupadd -r usbmuxd -g 113
getent passwd usbmuxd >/dev/null || \
useradd -r -g usbmuxd -d / -s /sbin/nologin \
	-c "usbmuxd user" -u 113 usbmuxd
exit 0
postinstall scriptlet (using /bin/sh):
/sbin/ldconfig
%systemd_post usbmuxd.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun usbmuxd.service
postuninstall scriptlet (using /bin/sh):
/sbin/ldconfig
%systemd_postun_with_restart usbmuxd.service

$ rpm -q --scripts -p usbmuxd-1.0.8-9.fc20.x86_64.rpm
warning: usbmuxd-1.0.8-9.fc20.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 246110c1: NOKEY
preinstall scriptlet (using /bin/sh):
getent group usbmuxd >/dev/null || groupadd -r usbmuxd -g 113
getent passwd usbmuxd >/dev/null || \
useradd -r -g usbmuxd -d / -s /sbin/nologin \
	-c "usbmuxd user" -u 113 usbmuxd
exit 0
postinstall scriptlet (using /bin/sh):
/sbin/ldconfig
%systemd_post usbmuxd.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun usbmuxd.service
postuninstall scriptlet (using /bin/sh):
/sbin/ldconfig
%systemd_postun_with_restart usbmuxd.service
Comment 3 Ralf Corsepius 2013-10-10 00:51:13 EDT
Created attachment 810282 [details]
Proposed fix

On fedora >= 20 packages using systemd-macros need to BR: systemd, otherwise systemd-macros won't get expanded.

Unless somebody objects soonish, I'll apply this patch to rawhide and f20.
Comment 4 Peter Robinson 2013-10-10 04:37:25 EDT
No objection, feel free to push
Comment 5 Fedora Update System 2013-10-10 05:06:29 EDT
usbmuxd-1.0.8-10.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/usbmuxd-1.0.8-10.fc20
Comment 6 Ralf Corsepius 2013-10-10 05:08:16 EDT
(In reply to Peter Robinson from comment #4)
> No objection, feel free to push

Thanks, done.
Comment 7 Orion Poplawski 2013-10-10 10:42:51 EDT
This is a problem for F18+.
Comment 8 Ralf Corsepius 2013-10-10 11:24:06 EDT
(In reply to Orion Poplawski from comment #7)
> This is a problem for F18+.

You are right. I am going to also push f19.
Comment 9 Fedora Update System 2013-10-10 11:44:11 EDT
usbmuxd-1.0.8-10.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/usbmuxd-1.0.8-10.fc19
Comment 10 Fedora Update System 2013-10-10 22:30:14 EDT
Package usbmuxd-1.0.8-10.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing usbmuxd-1.0.8-10.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18797/usbmuxd-1.0.8-10.fc19
then log in and leave karma (feedback).
Comment 11 Andre Robatino 2013-10-11 00:33:53 EDT
After updating to usbmuxd-1.0.8-10.fc19, removing the old version manually, and then reinstalling this version, didn't get any scriptlet errors. Same with usbmuxd-1.0.8-10.fc20.
Comment 12 Peter Robinson 2013-10-11 05:58:15 EDT
*** Bug 1018119 has been marked as a duplicate of this bug. ***
Comment 13 collura 2013-10-12 00:22:16 EDT
i didnt try manual remove but when updates came through to fc19 i got a yum error:

"/var/tmp/rpm-tmp.RdWmpu: line 1: fg: no job control
error: %preun(usbmuxd-1.0.8-9.fc19.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package usbmuxd-1.0.8-9.fc19.x86_64
error: usbmuxd-1.0.8-9.fc19.x86_64: erase failed
"
Comment 14 Andre Robatino 2013-10-12 00:29:30 EDT
Yes, when you updated to the new version 1.0.8-10.fc19, the old version 1.0.8-9.fc19 was uninstalled, and its associated PREUN scriptlet, which is broken, caused this error. You have to remove the old version manually with "rpm -e --nopreun usbmuxd-1.0.8-9.fc19.x86_64". After that, you can verify that the new version's PRE and POST scriptlets are good by yum reinstalling it, and if you yum downgrade to the old version again, you won't see any errors, showing that the new version's PREUN and POSTUN scriptlets are also good. (Of course, when you update back to the new version you'll see the old version's PREUN error again, and have to again manually remove it.)
Comment 15 collura 2013-10-12 00:44:15 EDT
Created attachment 811508 [details]
how manual did you have to get for the packaging remove?
Comment 16 Andre Robatino 2013-10-12 00:46:58 EDT
AFAIK you can't turn off rpm scriptlets with yum, you have to use the rpm command directly as indicated above.
Comment 17 collura 2013-10-12 00:57:07 EDT
thanks i had missed your comment#14 before i posted #15, sorry these crossed in ether. :')
  
i used your 'rpm -e' as you suggested.

'rpm -e' gave an error but 1.0.8-9 is then gone from the list afterwards so looks like that cleared it:

rpm -e --nopreun usbmuxd-1.0.8-9.fc19.x86_64
/var/tmp/rpm-tmp.Jnh1Pi: line 2: fg: no job control
warning: %postun(usbmuxd-1.0.8-9.fc19.x86_64) scriptlet failed, exit status 1

sudo yum list usbmuxd
Loaded plugins: langpacks, refresh-packagekit
Installed Packages
usbmuxd.x86_64                                      1.0.8-10.fc19                                       @updates-testing
Available Packages
usbmuxd.i686        

thanks again.
Comment 18 Andre Robatino 2013-10-12 01:04:34 EDT
I believe that without the --nopreun, it will say "error", not "warning", and not remove the rpm. I don't know why it still says "warning" - the rpm man page seems to indicate that --nopreun is supposed to turn off the PREUN, so you shouldn't see a warning, but it looks like what actually happens is that it tries to run it, but ignores it when it fails, so the package gets removed.
Comment 19 Ralf Corsepius 2013-10-12 04:32:11 EDT
(In reply to collura from comment #13)
> "/var/tmp/rpm-tmp.RdWmpu: line 1: fg: no job control
> error: %preun(usbmuxd-1.0.8-9.fc19.x86_64) scriptlet failed, exit status 1
> Error in PREUN scriptlet in rpm package usbmuxd-1.0.8-9.fc19.x86_64
> error: usbmuxd-1.0.8-9.fc19.x86_64: erase failed
> "

Note: There are 2 errors with this package interacting.
One was fixed in *-9, another one was fixed in *-10. 

The rpmdb scriptlet error/rpmdb-breakage only occurs when upgrading from *-8 or *-9 to *-10.

With current update paths, this means
* On F19, this hard error only occurs when *-9 from updates-testing was installed.

When not having updates-testing installed, an update from *-7 to *-10 will happen, which only exposes a warning:
/var/tmp/rpm-tmp.GqgIut: line 8: fg: no job control

* On F20, this hard-error always occurs, because the current version in "Fedora+updates" is *-8.

To cut a long story short: On "yum update"s, normal F19 users, who don't have updates-testing activated, will see a warning. 
F19-users, who have updates-testing activated and F20 users will face the error and duplicate rpmdb entries.
Comment 20 Peter Robinson 2013-10-12 06:33:10 EDT
*** Bug 1018418 has been marked as a duplicate of this bug. ***
Comment 21 Fedora Update System 2013-10-13 15:54:02 EDT
usbmuxd-1.0.8-10.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Fedora Update System 2013-10-14 03:09:11 EDT
usbmuxd-1.0.8-10.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 23 Fedora Update System 2013-10-14 13:15:20 EDT
usbmuxd-1.0.8-10.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 24 Panu Matilainen 2013-10-23 05:35:43 EDT
*** Bug 1022420 has been marked as a duplicate of this bug. ***
Comment 25 Peter Robinson 2013-11-11 13:46:30 EST
*** Bug 1028824 has been marked as a duplicate of this bug. ***
Comment 26 Peter Robinson 2013-11-18 04:59:49 EST
*** Bug 1031507 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.