Skip to content

dnf needs-restarting incorrectly reports services need restart after system clock change #595

@RomanSoloweow

Description

@RomanSoloweow

Description:
When the system clock is shifted backwards, dnf needs-restarting incorrectly reports that some services require a restart, even though no packages were updated.

Steps to Reproduce:

  1. Run dnf needs-restarting (no restarts should be required).
  2. Move the system clock back, e.g.:
    sudo date -s "-2 hours"
  3. Run dnf needs-restarting again.

Actual result:
For the duration of the shifted time window (e.g. 2 hours if the clock was set 2 hours back), dnf needs-restarting incorrectly reports that some services need to be restarted.

Expected result:
Changing system time should not affect dnf needs-restarting output, since no packages or services were actually updated.

Notes:
It seems that needs-restarting relies on absolute wall clock timestamps when comparing process start times with package update times. As a result, moving the clock backwards makes processes appear older than the last package update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions