Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

needs-restarting: Get boot time from systemd UnitsLoadStartTimestamp #576

Merged

Conversation

evan-goode
Copy link
Member

Backport of #560 to RHEL 10.0.

Resolves: https://issues.redhat.com/browse/RHEL-35577

Resolves https://issues.redhat.com/browse/RHEL-35577.

Get the boot time from UnitsLoadStartTimestamp if systemd is available,
but make sure to use the kernel boot time for calculating process start
times using data from procfs. The previous attempt [1] at this failed to
do so and introduced a regression [2].

Also, get the kernel boot time from the btime field of /proc/stat instead of
calculating it from /proc/uptime, to be consistent with what procps-ng
does.

[1] rpm-software-management#527
[2] https://issues.redhat.com/browse/RHEL-39775
@ppisar ppisar self-assigned this Jan 22, 2025
@ppisar
Copy link
Contributor

ppisar commented Jan 22, 2025

This commit equals to a commit from master branch which is good.

But I believe we should readd UnitsLoadStartTimestamp entry to doc/needs_restarting.rst which we originally added in a0ac871, reverted with the code in commit f84b7e0 and forgot to readd in the #560 pull request for master branch.

The lost documentation was:

   ``UnitsLoadStartTimestamp``
        D-Bus property on ``/org/freedesktop/systemd1``.
        Works unless the system was not booted with systemd,
        such as in (most) containers.

just above st_mtime of /proc/1 line.

Could you please create a pull request against master and then add the commit to this rhel-10.0 pull request?

@evan-goode
Copy link
Member Author

Done, good catch. Here is the PR against master: #577.

Copy link
Contributor

@ppisar ppisar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@ppisar ppisar merged commit 54b9f83 into rpm-software-management:rhel-10.0 Jan 23, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants