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:
- Run dnf needs-restarting (no restarts should be required).
- Move the system clock back, e.g.:
sudo date -s "-2 hours"
- 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.
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:
sudo date -s "-2 hours"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.