Bug 1637496 - "%systemd_post rtkit-daemon.service" found in postinstall script
Summary: "%systemd_post rtkit-daemon.service" found in postinstall script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rtkit
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException https://fedor...
: 1637882 1638946 1639138 1641214 1646864 1674108 1691201 1700551 (view as bug list)
Depends On:
Blocks: F29FinalBlocker F29FinalFreezeException
TreeView+ depends on / blocked
 
Reported: 2018-10-09 11:08 UTC by Villy Kruse
Modified: 2020-03-10 00:44 UTC (History)
23 users (show)

Fixed In Version: rtkit-0.11-20.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-11 20:29:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Villy Kruse 2018-10-09 11:08:53 UTC
Description of problem:


Postinstall and preuninstall scripts contain onresolved rpm macro.



$ rpm -qp --scripts rtkit-0.11-19.fc29.i686.rpm
preinstall scriptlet (using /bin/sh):
getent group rtkit >/dev/null 2>&1 || groupadd \
        -r \
        -g 172 \
        rtkit
getent passwd rtkit >/dev/null 2>&1 || useradd \
        -r -l \
        -u 172 \
        -g rtkit \
        -d /proc \
        -s /sbin/nologin \
        -c "RealtimeKit" \
        rtkit
:;
postinstall scriptlet (using /bin/sh):
%systemd_post rtkit-daemon.service                   <<<<<<<<<<<<<<<<<<<<<<<<
dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
preuninstall scriptlet (using /bin/sh):
%systemd_preun rtkit-daemon.service                  <<<<<<<<<<<<<<<<<<<<<<<<
postuninstall scriptlet (using /bin/sh):
%systemd_postun                                      <<<<<<<<<<<<<<<<<<<<<<<<




$ rpm -qp --scripts rtkit-0.11-19.fc29.x86_64.rpm
preinstall scriptlet (using /bin/sh):
getent group rtkit >/dev/null 2>&1 || groupadd \
        -r \
        -g 172 \
        rtkit
getent passwd rtkit >/dev/null 2>&1 || useradd \
        -r -l \
        -u 172 \
        -g rtkit \
        -d /proc \
        -s /sbin/nologin \
        -c "RealtimeKit" \
        rtkit
:;
postinstall scriptlet (using /bin/sh):
%systemd_post rtkit-daemon.service                  <<<<<<<<<<<<<<<<<<<<
dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
preuninstall scriptlet (using /bin/sh):
%systemd_preun rtkit-daemon.service                 <<<<<<<<<<<<<<<<<<<<
postuninstall scriptlet (using /bin/sh):
%systemd_postun                                     <<<<<<<<<<<<<<<<<<<<<

Comment 1 Fedora Update System 2018-10-09 13:00:42 UTC
rtkit-0.11-20.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-66f441eb34

Comment 2 Fedora Update System 2018-10-09 20:03:30 UTC
rtkit-0.11-20.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-66f441eb34

Comment 3 Kamil Páral 2018-10-10 07:51:41 UTC
Proposing as a blocker. rtkit-0.11-19.fc29.x86_64 is currently stable and can't be updated, the transaction fails:

...
  Running scriptlet: rtkit-0.11-19.fc29.x86_64                                                                 99/132 
/var/tmp/rpm-tmp.3Jy2SS: line 1: fg: no job control
error: %preun(rtkit-0.11-19.fc29.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package rtkit
Error in PREUN scriptlet in rpm package rtkit
...
Failed:
  rtkit-0.11-19.fc29.x86_64                                                                                           

Error: Transaction failed

$ sudo dnf check
[sudo] password for kparal: 
rtkit-0.11-19.fc29.x86_64 is a duplicate with rtkit-0.11-20.fc29.x86_64
Error: Check discovered 1 problem(s)


The only way to remove it is using:
$ sudo rpm -e rtkit-0.11-19.fc29.x86_64 --noscripts


This broken package is installed by default (at least in Workstation) and prevents future updates. We need to fix it before making a stable F29 release. Also, this is probably a good candidate for common bugs, because it will affect most existing F29 pre-release users.

Comment 4 Fedora Blocker Bugs Application 2018-10-10 07:52:57 UTC
Proposed as a Freeze Exception for 29-final by Fedora user frieben using the blocker tracking app because:

 Package rtkit-0.11-19.fc29 is included in the live image Fedora-Workstation-Live-x86_64-29-20181009.n.0 but because of present issue, it cannot be upgraded to rtkit-0.11-20.fc29. The updated package should therefore be an exception to the current freeze.

Comment 5 Kamil Páral 2018-10-10 07:53:39 UTC
(In reply to Fedora Update System from comment #1)
> rtkit-0.11-20.fc29 has been submitted as an update to Fedora 29.
> https://bodhi.fedoraproject.org/updates/FEDORA-2018-66f441eb34

This fixes the problem.

Comment 6 Zbigniew Jędrzejewski-Szmek 2018-10-10 09:38:22 UTC
*** Bug 1637882 has been marked as a duplicate of this bug. ***

Comment 7 Villy Kruse 2018-10-10 11:03:05 UTC
(In reply to Kamil Páral from comment #3)
> Proposing as a blocker. rtkit-0.11-19.fc29.x86_64 is currently stable and
> can't be updated, the transaction fails:
> 
> ...
>   Running scriptlet: rtkit-0.11-19.fc29.x86_64                              
> 99/132 
> /var/tmp/rpm-tmp.3Jy2SS: line 1: fg: no job control
> error: %preun(rtkit-0.11-19.fc29.x86_64) scriptlet failed, exit status 1
> Error in PREUN scriptlet in rpm package rtkit
> Error in PREUN scriptlet in rpm package rtkit
> ...
> Failed:
>   rtkit-0.11-19.fc29.x86_64                                                 
> 
> 
> Error: Transaction failed
> 
> $ sudo dnf check
> [sudo] password for kparal: 
> rtkit-0.11-19.fc29.x86_64 is a duplicate with rtkit-0.11-20.fc29.x86_64
> Error: Check discovered 1 problem(s)
> 
> 
> The only way to remove it is using:
> $ sudo rpm -e rtkit-0.11-19.fc29.x86_64 --noscripts
> 
> 
> This broken package is installed by default (at least in Workstation) and
> prevents future updates. We need to fix it before making a stable F29
> release. Also, this is probably a good candidate for common bugs, because it
> will affect most existing F29 pre-release users.


It can get worse:  If you ever reinstalled rtkit-0.11-19.fc29.x86_64 then you are left with a duplicate entry in the rpm data base, and rpm will refuse to remove the duplicate.

Comment 8 Ali Akcaagac 2018-10-10 11:40:31 UTC
(In reply to Villy Kruse from comment #7)
> It can get worse:  If you ever reinstalled rtkit-0.11-19.fc29.x86_64 then
> you are left with a duplicate entry in the rpm data base, and rpm will
> refuse to remove the duplicate.

Like this:

[aakcaagac@localhost ~]$ rpm -qa | grep -i "rtk"
rtkit-0.11-20.fc29.x86_64
rtkit-0.11-19.fc29.x86_64
[aakcaagac@localhost ~]$ 


I usually enfore "rpm -e --nodeps rtkit" to remove all traces of rtkit from the rpm database. Then I re-install rtkit from scratch. Still... Annoying...

Comment 9 Villy Kruse 2018-10-10 13:07:50 UTC
(In reply to Ali Akcaagac from comment #8)
> (In reply to Villy Kruse from comment #7)

> Like this:
> 
> [aakcaagac@localhost ~]$ rpm -qa | grep -i "rtk"
> rtkit-0.11-20.fc29.x86_64
> rtkit-0.11-19.fc29.x86_64
> [aakcaagac@localhost ~]$ 
> 
> 

No, like this.
 rtkit-0.11-19.fc29.x86_64
 rtkit-0.11-19.fc29.x86_64

I had rtkit-0.11-19.fc29.x86_64 installed and the re-install created a second rtkit-0.11-19.fc29.x86_64

Comment 10 kxra 2018-10-10 13:22:33 UTC
Is there a workaround? I tried `rpm -e --nodeps` but still get: 

```
/var/tmp/rpm-tmp.ga0qth: line 1: fg: no job control
error: %preun(rtkit-0.11-19.fc29.x86_64) scriptlet failed, exit status 1
error: rtkit-0.11-19.fc29.x86_64: erase failed
```

Comment 11 Andre Robatino 2018-10-10 13:24:22 UTC
"rpm -e --nopreun rtkit-0.11-19.fc29.x86_64" worked for me.

Comment 12 Villy Kruse 2018-10-10 14:04:57 UTC
(In reply to Villy Kruse from comment #9)
> (In reply to Ali Akcaagac from comment #8)
> > (In reply to Villy Kruse from comment #7)
> 
> > Like this:
> > 
> > [aakcaagac@localhost ~]$ rpm -qa | grep -i "rtk"
> > rtkit-0.11-20.fc29.x86_64
> > rtkit-0.11-19.fc29.x86_64
> > [aakcaagac@localhost ~]$ 
> > 
> > 
> 
> No, like this.
>  rtkit-0.11-19.fc29.x86_64
>  rtkit-0.11-19.fc29.x86_64
> 
> I had rtkit-0.11-19.fc29.x86_64 installed and the re-install created a
> second rtkit-0.11-19.fc29.x86_64

More specifically

[root@secondbux ~]# rpm -q rtkit
rtkit-0.11-19.fc29.x86_64
rtkit-0.11-20.fc29.x86_64
rtkit-0.11-19.fc29.x86_64
[root@secondbux ~]# rpm -e --nodeps --noscript rtkit
error: "rtkit" specifies multiple packages:
  rtkit-0.11-19.fc29.x86_64
  rtkit-0.11-20.fc29.x86_64
  rtkit-0.11-19.fc29.x86_64
[root@secondbux ~]# rpm -e --nodeps --noscript rtkit-0.11-19.fc29.x86_64
error: "rtkit-0.11-19.fc29.x86_64" specifies multiple packages:
  rtkit-0.11-19.fc29.x86_64
  rtkit-0.11-19.fc29.x86_64
[root@secondbux ~]#

Comment 13 Villy Kruse 2018-10-10 14:06:22 UTC
(In reply to kxra from comment #10)
> Is there a workaround? I tried `rpm -e --nodeps` but still get: 
> 
> ```
> /var/tmp/rpm-tmp.ga0qth: line 1: fg: no job control
> error: %preun(rtkit-0.11-19.fc29.x86_64) scriptlet failed, exit status 1
> error: rtkit-0.11-19.fc29.x86_64: erase failed
> ```

See comment no 3.

Comment 14 Ali Akcaagac 2018-10-10 14:35:25 UTC
Sorry my bad. I had to reconstruct the line out of memory.

rpm -e --nodeps --justdb rtkit

-e = erase
--nodeps = skip dependency
--justdb = work on database only

Means! It only removes the entries from the db. The package still exists on your system. But you can then dnf install rtkit again.

Now that we don't have the yumdb stuff anymore, you can issue the rpm install from commandline, in case dnf fails.

Comment 15 Adam Williamson 2018-10-10 15:02:47 UTC
At least +1 FE for me.

Comment 16 Kevin Fenzi 2018-10-10 15:04:41 UTC
+1 FE

Comment 17 Mohan Boddu 2018-10-10 15:04:57 UTC
+1 FE

Comment 18 Adam Williamson 2018-10-10 15:24:13 UTC
That's +3, marking as accepted FE.

Comment 19 Ali Akcaagac 2018-10-10 17:21:18 UTC
#!/bin/bash --login
# Begin rtkit.sh

rtkit=`rpm -qa rtkit`

for i in ${rtkit} ; do
	echo "processing: \"${i}\""

	rpm -e --nodeps --justdb "${i}"
done

dnf -y install rtkit

exit
# End rtkit.sh

Comment 20 Ali Akcaagac 2018-10-10 17:23:13 UTC
Please save above as rtkit.sh and run it as root. This will erase all entries of rtkit from rpm (database only) and then installs rtkit fresh from repository.

Also note! As far as I remember, there was plenty of other duplicate entries early, when I tried F29 before the branch was created.

So in doubt please check for other duplicate entries in your rpm database.

Comment 21 Lukas Ruzicka 2018-10-11 11:20:11 UTC
I can confirm, that Ali's approach (comment #19) works. Even if you do not want to use a script but issue the commands individually.

Also, the new rtkit (0.11.20) can be installed without any issues.

Comment 22 Fedora Update System 2018-10-11 20:29:05 UTC
rtkit-0.11-20.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Zbigniew Jędrzejewski-Szmek 2018-10-13 09:12:06 UTC
*** Bug 1638946 has been marked as a duplicate of this bug. ***

Comment 24 Christian von Behren 2018-10-14 12:16:34 UTC
> [root@secondbux ~]# rpm -e --nodeps --noscript rtkit
> error: "rtkit" specifies multiple packages:
>   rtkit-0.11-19.fc29.x86_64
>   rtkit-0.11-20.fc29.x86_64
>   rtkit-0.11-19.fc29.x86_64

to remove all instances of the same v19 package use
sudo rpm -e --nodeps --allmatches --justdb rtkit-0.11-19.fc29.x86_64

the bash script will not help you either as each call in the loop to drop a package will fail as you have multiple instances of the same package installed and cannot delete them without --allmatches!!

after that, just reinstall the 20 again:
sudo dnf reinstall rtkit-0.11-20.fc29.x86_64

problem solved ;-)

Comment 25 Zbigniew Jędrzejewski-Szmek 2018-10-15 07:14:12 UTC
*** Bug 1639138 has been marked as a duplicate of this bug. ***

Comment 26 Zbigniew Jędrzejewski-Szmek 2018-10-22 20:54:08 UTC
*** Bug 1641214 has been marked as a duplicate of this bug. ***

Comment 27 Zbigniew Jędrzejewski-Szmek 2018-11-06 08:06:25 UTC
*** Bug 1646864 has been marked as a duplicate of this bug. ***

Comment 28 Zbigniew Jędrzejewski-Szmek 2019-02-09 12:40:47 UTC
*** Bug 1674108 has been marked as a duplicate of this bug. ***

Comment 29 Zbigniew Jędrzejewski-Szmek 2019-03-21 07:33:56 UTC
*** Bug 1691201 has been marked as a duplicate of this bug. ***

Comment 30 Artem 2019-04-03 07:06:10 UTC
Same for me, just did upgrade to F30 (F29 was up-to-date), but still had rtkit-0.11-19.fc29 present in the system. Manual cleanup worked, but still not good for overall upgrade experience

Comment 31 Adam Williamson 2019-04-03 14:57:58 UTC
The way RPM works, if you were unfortunate enough to get 0.11-19.fc29 there's not much we can do about it, that package is just a trap :/  All we could do is get the fixed 0.11-20.fc29 out as fast as possible so people who installed F29 *after that point* weren't affected, but if you were running F29 when 0.11-19.fc29 came out you were basically always going to be stuck with this.

Sorry about that :(

Comment 32 Villy Kruse 2019-04-03 18:10:20 UTC
(In reply to Adam Williamson from comment #31)
> The way RPM works, if you were unfortunate enough to get 0.11-19.fc29
> there's not much we can do about it, that package is just a trap :/  All we
> could do is get the fixed 0.11-20.fc29 out as fast as possible so people who
> installed F29 *after that point* weren't affected, but if you were running
> F29 when 0.11-19.fc29 came out you were basically always going to be stuck
> with this.
> 
> Sorry about that :(

That fix was done before official release of fc29, so only people who installed fc29-beta were affected.

Comment 33 Christian Stadelmann 2019-04-16 21:43:14 UTC
*** Bug 1700551 has been marked as a duplicate of this bug. ***

Comment 34 Jan Pokorný [poki] 2020-03-09 19:24:26 UTC
Just wow, realized that I still have rtkit-0.11-19.fc29.x86_64 on my
system without ability to get rid of it easily (for what's expected
experience of your average Fedora user).

The way out:
rpm -e --noscripts rtkit-0.11-19.fc29.x86_64

(You noticed it was already suggested in [comment 3].)

Looks like it would be nice to have some sort of out-of-RPM (so
as to be able to call RPM commands, which shall be frowned upon
within transaction itself, correct?) pattern matching system
(like "rtkit = 0.11-19 && rtkit > 0.11-19") that would either
make some suggestions (send a message to some admin queue, like
implemented in Gentoo, for instance) or act right away.

Otherwise Fedora is rather far from either no-touch or
no-active-info-solicitation.  Would be nice to at least have
the latter (push model for important tasks to do rather than
pull -- be checking MLs, wikis and all other thinkable channels
in parallel).

(Makes me think if Fedora is really ready for long-term gradual
upgrade journey ... will for instance dnf grow the history logs
indefinitely or is there some vacuuming so there's no danger that
the package change transacations will eventually occupy most of the
system -- curiously, I see the transaction history back to 2017-01-05
on this system, which is nice, but not sure if that makes for
a resonable footprint in case this system would happen to continue
next 10+ years like this ... especially when slihtly hidden burps
like with rtkit will add up over time).

Comment 35 Christian Stadelmann 2020-03-09 21:24:58 UTC
(In reply to Jan Pokorný [poki] from comment #34)
> (Makes me think if Fedora is really ready for long-term gradual
> upgrade journey ... will for instance dnf grow the history logs
> indefinitely or is there some vacuuming so there's no danger that
> the package change transacations will eventually occupy most of the
> system -- curiously, I see the transaction history back to 2017-01-05
> on this system, which is nice, but not sure if that makes for
> a resonable footprint in case this system would happen to continue
> next 10+ years like this ... especially when slihtly hidden burps
> like with rtkit will add up over time).

On one computer I have dnf with ~2500 history entries since 2015-11-01 (Fedora 23). So as long as dnf is old I've not had an issue breaking my system or dnf history/database completely. I had to work around a few issues like this one though. dnf logs have log rotation (after 1MB in my case, adding up to about 10MB of logs for dnf/rpm/librepo/hawkey in total). /var/lib/dnf is 135MB out of which 21MB is for history.sqlite and 96MB is the history/ subfolder (looks like old backups).

In other words: given that fedora is relatively close to bleeding-edge, this looks quite good. If you want more stability, use a different distro ;)

Comment 36 Jan Pokorný [poki] 2020-03-09 23:35:25 UTC
Fair enough, but even on bleeding edge, you'd rather have some
assurances you may stay in the saddle for ages, not that you'll
be marked a fossil and recommended to start the ride anew.

This discontinuity is material, e.g. [bug 1598523 comment 11]
(which was exactly of this sort ... all works nicely on fresh
install, too bad that no-touch migration from older ones are
not a concern, IIRC).

Enough of off-topic and nagging, though, doesn't belong here,
I guess :-)

Comment 37 Adam Williamson 2020-03-10 00:44:30 UTC
I have 1856 transactions going back to 2013-12-15 in my dnf history. /var/lib/dnf/history is 99M.

This box was installed as Fedora 15 and is still going, so I'd say long-term upgrading is fine...


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