Bug 995158 - acpid: unexpaned rpm macro in post scriptlet
acpid: unexpaned rpm macro in post scriptlet
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: acpid (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
: Reopened
: 1000712 1000726 1001398 1001785 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-08 12:40 EDT by Paulo Andrade
Modified: 2014-02-12 09:06 EST (History)
10 users (show)

See Also:
Fixed In Version: acpid-2.0.19-6.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-14 10:24:15 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)

  None (edit)
Description Paulo Andrade 2013-08-08 12:40:44 EDT
After yum telling me I had two acpid packages installed, and
running:

$ sudo rpm -e --justdb --allmatches acpid
$ sudo yum install acpid

it still failed, because of:

$ rpm -q --scripts acpid
[...]
postinstall scriptlet (using /bin/sh):
%systemd_post acpid.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun acpid.service
postuninstall scriptlet (using /bin/sh):
%systemd_postun_with_restart acpid.service

Looks like a missing build requires (systemd, owner of
/usr/lib/rpm/macros.d/macros.systemd that defines the macro)
providing the proper macros, e.g.:

]$ rpm -E "%systemd_post acpid.service"

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        /usr/bin/systemctl preset acpid.service >/dev/null 2>&1 || : 
fi
Comment 1 Jaroslav Škarvada 2013-08-09 04:58:42 EDT
The macros are provided by systemd package:
$ repoquery --enablerepo=rawhide -ql systemd | grep macros.systemd
/usr/lib/rpm/macros.d/macros.systemd

$ repoquery --enablerepo=rawhide -q systemd
systemd-0:206-2.fc20.x86_64

The main requirement seems to be OK. I fixed the post, preun, postun requirements, which weren't correct. If the problem persists, please let me know.

Fixed in: acpid-2.0.19-4.fc20
Comment 2 Michal Jaegermann 2013-08-13 17:17:01 EDT
(In reply to Jaroslav Škarvada from comment #1)

> 
> Fixed in: acpid-2.0.19-4.fc20

I am afraid that this is not really the case.  Both in acpid-2.0.19-4.fc20 and 
acpid-2.0.19-5.fc20 I see in package scripts:
.....
postinstall scriptlet (using /bin/sh):
%systemd_post acpid.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun acpid.service
postuninstall scriptlet (using /bin/sh):
%systemd_postun_with_restart acpid.service

Moreover, on an update I got in a cleanup phase:

error: acpid-2.0.19-4.fc20.x86_64: erase failed

and after that 'rpm -q acpid' shows:

acpid-2.0.19-4.fc20.x86_64
acpid-2.0.19-5.fc20.x86_64

and this will require cleaning up with '... --noscripts ...'.
Comment 3 Michal Jaegermann 2013-08-13 17:23:35 EDT
Oh, and multiple packages now show similar troubles.  See in particular bug 983760 which claims that this is there at last resolved.  I guess that a mysterious "BR" is supposed to stand for "BuildRequires" but why systemd needs to be present to expand some rpm macros is something which leaves me somewhat baffled.
Comment 4 Jaroslav Škarvada 2013-08-14 04:43:23 EDT
Probably not an acpid issue. The requires are compliant with the guideline:

> Requires(post): systemd
> Requires(preun): systemd
> Requires(postun): systemd
> Requires: systemd

Could you explain how the build time dependency could affect the runtime?
Comment 5 Jaroslav Škarvada 2013-08-14 10:16:15 EDT
This is ugly, the macro is expanded in build time.
Comment 6 Jaroslav Škarvada 2013-08-14 10:23:59 EDT
Thanks for the report, it should be fixed in acpid-2.0.19-6.fc20. The F19 seems to be also affected, backporting there. The problem probably appear by some implicit build dep that was removed.
Comment 7 Michal Jaegermann 2013-08-14 10:31:47 EDT
(In reply to Jaroslav Škarvada from comment #4)
> 
> Could you explain how the build time dependency could affect the runtime?

If this was a question to me then I wrote explicitely "leaves me somewhat baffled".  This was a claim in comments to bug 983760.  If this is correct then some weirdness in a build system, I guess.  Yes, rpm package macros need to be expanded in a build time but for that they only need to be defined at that stage.  Sounds to me like something which should be independent on a presence of systemd itself.
Comment 8 Fedora Update System 2013-08-14 10:34:42 EDT
acpid-2.0.19-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/acpid-2.0.19-6.fc19
Comment 9 Jaroslav Škarvada 2013-08-14 10:47:22 EDT
(In reply to Michal Jaegermann from comment #7)
The macro is provided by 'systemd' package. The 'systemd' package was previously required by some package that was implicit dep of the build system (I do not have time to trace it down). This was changed by some recent update. The packaging guidelines are in sync with this change.
Comment 10 Jaroslav Škarvada 2013-08-26 04:07:04 EDT
*** Bug 1000726 has been marked as a duplicate of this bug. ***
Comment 11 Jaroslav Škarvada 2013-08-26 04:08:56 EDT
*** Bug 1000712 has been marked as a duplicate of this bug. ***
Comment 12 Morten Stevens 2013-08-26 07:59:38 EDT
2.0.19-6:

[root@fc19 ~]# rpm -q acpid
acpid-2.0.19-5.fc19.x86_64
[root@fc19 ~]# yum remove acpid
Resolving Dependencies
--> Running transaction check
---> Package acpid.x86_64 0:2.0.19-5.fc19 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch            Version                 Repository         Size
================================================================================
Removing:
 acpid          x86_64          2.0.19-5.fc19           @updates          145 k

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 145 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
/var/tmp/rpm-tmp.AUCo07: line 1: fg: no job control
error: %preun(acpid-2.0.19-5.fc19.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package acpid-2.0.19-5.fc19.x86_64
  Verifying  : acpid-2.0.19-5.fc19.x86_64                                   1/1

Failed:
  acpid.x86_64 0:2.0.19-5.fc19
Comment 13 Morten Stevens 2013-08-26 08:04:46 EDT
The update to 2.0.19-6 also fails:

[root@fc19 ~]# yum update acpid
updates-testing/19/x86_64/metalink                       |  27 kB     00:00
updates-testing                                          | 4.6 kB     00:00
(1/2): updates-testing/19/x86_64/group_gz                  | 385 kB   00:00
(2/2): updates-testing/19/x86_64/primary_db                | 991 kB   00:00
(1/2): updates-testing/19/x86_64/updateinfo                | 418 kB   00:00
(2/2): updates-testing/19/x86_64/pkgtags                   | 497 kB   00:00
Resolving Dependencies
--> Running transaction check
---> Package acpid.x86_64 0:2.0.19-5.fc19 will be updated
---> Package acpid.x86_64 0:2.0.19-6.fc19 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch          Version                Repository              Size
================================================================================
Updating:
 acpid        x86_64        2.0.19-6.fc19          updates-testing         68 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 68 k
Is this ok [y/d/N]: y
Downloading packages:
acpid-2.0.19-6.fc19.x86_64.rpm                             |  68 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : acpid-2.0.19-6.fc19.x86_64                                   1/2
/var/tmp/rpm-tmp.8P7Woy: line 1: fg: no job control
error: %preun(acpid-2.0.19-5.fc19.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package acpid-2.0.19-5.fc19.x86_64
  Verifying  : acpid-2.0.19-6.fc19.x86_64                                   1/2
  Verifying  : acpid-2.0.19-5.fc19.x86_64                                   2/2

Updated:
  acpid.x86_64 0:2.0.19-6.fc19

Failed:
  acpid.x86_64 0:2.0.19-5.fc19

It is now installed twice?

[root@fc19 ~]# rpm -q acpid
acpid-2.0.19-5.fc19.x86_64
acpid-2.0.19-6.fc19.x86_64
Comment 14 Morten Stevens 2013-08-26 08:20:36 EDT
Update:
2.0.19-6 works fine on a clean install. It's only a problem during the update from 2.0.19-5 to 2.0.19-6.
Comment 15 Jaroslav Škarvada 2013-08-26 08:30:18 EDT
Sorry for the inconvenience, you need to use rpm with --noscripts to get rid of the 2.0.19-5. It's a pity it was not caught by the QE, it was in the testing for week or more.
Comment 16 Fedora Update System 2013-08-26 18:28:49 EDT
acpid-2.0.19-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 17 Jaroslav Škarvada 2013-08-28 08:01:02 EDT
*** Bug 1001785 has been marked as a duplicate of this bug. ***
Comment 18 Marek Zdunek 2013-09-30 11:38:13 EDT
today's problem with updating:

  Czyszczenie              : acpid.x86_64                                                                                                                                             378/394 
/var/tmp/rpm-tmp.HJp543: line 1: fg: brak kontroli zadań
error: %preun(acpid-2.0.19-5.fc19.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package acpid
  Czyszczenie              : zeromq3-3.2.3-1.fc19.x86_64                                                                                                                              379/394 
error: acpid-2.0.19-5.fc19.x86_64: erase failed
  Czyszczenie              : nscd.x86_64                                                                                                                                              380/394 
/var/tmp/rpm-tmp.OSGm9F: line 1: fg: brak kontroli zadań
error: %preun(nscd-2.17-13.fc19.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package nscd
  Czyszczenie              : 2:microcode_ctl-2.0-4.fc19.x86_64                                                                                                                        381/394 
error: nscd-2.17-13.fc19.x86_64: erase failed

rpm -qa | grep acpid
acpid-2.0.19-5.fc19.x86_64
acpid-2.0.20-1.fc19.x86_64

also nscd stills there
Comment 19 Marek Zdunek 2013-09-30 11:52:19 EDT
ok I found solution in rbz1001785 

rpm -e --noscripts acpid-2.0.19-5
rpm -e --noscripts nscd-2.17-13.fc19.x86_64
Comment 20 Grzegorz Witkowski 2013-10-06 17:39:39 EDT
[root@aspire ~]# yum check
Loaded plugins: langpacks, refresh-packagekit
acpid-2.0.20-1.fc19.x86_64 is a duplicate with acpid-2.0.19-5.fc19.x86_64
[root@aspire ~]# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	Fedora
Description:	Fedora release 19 (Schrödinger’s Cat)
Release:	19
Codename:	Schrödinger’sCat
[root@aspire ~]# uname -a
Linux aspire.localdomain 3.10.11-200.fc19.x86_64 #1 SMP Mon Sep 9 13:03:01 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@aspire ~]
Comment 21 Jaroslav Škarvada 2013-10-30 04:42:45 EDT
*** Bug 1001398 has been marked as a duplicate of this bug. ***
Comment 22 Jaroslav Škarvada 2014-02-10 08:21:58 EST
*** Bug 1058369 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.