Bug 1811506 - fstrim.timer is not enabled on upgrades
Summary: fstrim.timer is not enabled on upgrades
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-09 04:47 UTC by Chris Murphy
Modified: 2020-04-15 09:14 UTC (History)
3 users (show)

Fixed In Version: util-linux-2.35.1-7.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-30 00:16:51 UTC
Type: Bug


Attachments (Terms of Use)
rpm debug (288.93 KB, text/plain)
2020-03-20 04:48 UTC, Chris Murphy
no flags Details

Description Chris Murphy 2020-03-09 04:47:13 UTC
Description of problem:

Clean installs have it enabled. But upgrades do not get reset.

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


How reproducible:
Always


Steps to Reproduce:
1. Clean install F31
2. dnf system-upgrade
3.

Actual results:

$ systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● fstrim.service
       Docs: man:fstrim



Expected results:

Should be enabled and running.


Additional info:

This appears to be working, vendor preset is enabled
/usr/lib/systemd/system-preset/90-default.preset:enable fstrim.timer


But this seems to not be resetting it to the vendor preset value.

https://src.fedoraproject.org/rpms/util-linux/blob/master/f/util-linux.spec#_488

Does it get the fedora release value from /etc/fedora-release? If so, does the order of upgrade matter? fedora-release is 32 by the time util-linux runs. I wonder if there's a way to mark this as >= 32 ?

Mar 08 21:46:58 localhost.localdomain dnf[671]:   Upgrading        : fedora-release-common-32-0.6.noarch                91/3292

Mar 08 21:49:01 localhost.localdomain dnf[671]:   Upgrading        : util-linux-2.35.1-4.fc32.x86_64                   744/3292

Comment 1 Chris Murphy 2020-03-09 04:52:25 UTC
Since it works on clean installs, freeze exception doesn't apply. It can be a "zero day" update following the lifting of freeze. System upgrades will get an updated version that enables this, once the update goes stable.

Comment 2 Chris Murphy 2020-03-10 23:29:13 UTC
Modifed /etc/dnf/dnf.conf to include
rpmverbosity=debug

Then did a system upgrade. I see multiple cases of %triggerpostun, but none relate to either util-linux, fedora-release. And also, there is no reference to 'fedora-release' at all in the entire ~2000 rpm upgrade run.

My hypothesis is that the spec file should be changed:

- %triggerpostun -- fedora-release < 32
+ %triggerpostun -- fedora-release-common < 32

Comment 3 Chris Murphy 2020-03-11 00:14:28 UTC
The 'fedora-release' package does not appear on any Fedora 30/31/32 Edition or spin; there's fedora-release-common on all of them; and also fedora-release-workstation (or server, etc).

Comment 4 Chris Murphy 2020-03-16 20:53:17 UTC
Since util-linux-2.35 is only on f32+, how about doing the reset based on util-linux < 2.35?

I've asked on devel@, packaging@, #fedora-devel, and there's no completely clear answer what the correct way to do this with fedora-release is.

Comment 5 Karel Zak 2020-03-17 08:53:21 UTC
Do you mean

  %triggerpostun -- util-linux < 2.35

Comment 6 Chris Murphy 2020-03-17 13:14:39 UTC
Yes. Let me know if you want a PR for it.

Comment 7 Fedora Update System 2020-03-19 09:43:30 UTC
FEDORA-2020-686c838281 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-686c838281

Comment 9 Fedora Update System 2020-03-20 01:58:42 UTC
util-linux-2.35.1-6.fc32 has been pushed to the Fedora 32 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-2020-686c838281

Comment 10 Chris Murphy 2020-03-20 04:48:38 UTC
Created attachment 1671693 [details]
rpm debug

No good. 

I think it triggers at line 4077, but it does not do systemd preset. Before updating util-linux, I did check that the vendor preset is enabled, but after replacing util-linux 2.34 with 2.35, it's still disabled.

   Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: enabled)


https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/M7N3IPDCUMWRB7CA337B53RPIN56CWKU/

Comment 11 Kalev Lember 2020-03-24 12:58:52 UTC
I took a look at this and https://src.fedoraproject.org/rpms/util-linux/pull-request/4 should make it work correctly.

Karel, if if the fix looks good to you, I'm happy to handle bodhi updates and etc (I'm provenpackager)

Comment 12 Karel Zak 2020-03-24 14:23:20 UTC
(In reply to Kalev Lember from comment #11)
> I took a look at this and
> https://src.fedoraproject.org/rpms/util-linux/pull-request/4 should make it
> work correctly.
> 
> Karel, if if the fix looks good to you, I'm happy to handle bodhi updates
> and etc (I'm provenpackager)

It seems good. Did you you tried? 

Chris, any objection?

Comment 13 Chris Murphy 2020-03-24 14:41:42 UTC
No objection. I'll test once it hits u-t.

Comment 14 Kalev Lember 2020-03-24 14:56:40 UTC
> It seems good. Did you you tried?

Great, thanks! Yes, it worked fine in my testing. I'll go and build this then.

Comment 15 Fedora Update System 2020-03-24 19:55:42 UTC
FEDORA-2020-14d9238469 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-14d9238469`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-14d9238469

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-03-30 00:16:51 UTC
FEDORA-2020-14d9238469 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2020-04-15 09:14:46 UTC
FEDORA-2020-eedbcc85f7 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-eedbcc85f7


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