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

systemd: Show package updates status on front page #8822

Merged
merged 4 commits into from
Mar 21, 2018

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Mar 13, 2018

Show a summary indicator on the system front page whether the host has
available package updates.

https://bugzilla.redhat.com/show_bug.cgi?id=1495543
Fixes #7758

follow-ups:

@martinpitt martinpitt added the blocked Don't land until something else happens first (see task list) label Mar 13, 2018
@martinpitt
Copy link
Member Author

martinpitt commented Mar 13, 2018

Screenshot from my system:

system-update-indicator

Or for security updates:

system-security-updates

Clicking on the link leads to "Software Updates". If cockpit-packagekit is not installed, it's not a link, just text. If the system is not registered:

system-update-indicator-unregistered

Again, clicking on it leads to /subscriptions (if installed, otherwise it's just a normal text).

While the updates are loading, there is a spinner icon with "Checking For Updates…". It usually appears < 1 s as this does not have to load any details about the updates. This is also the reason why it does not see the individual Red Hat security update severity classification, but I think this is a worthwhile tradeoff for a massively faster result.

@andreasn
Copy link
Contributor

I tested it on my system, and the Server page said "Bug Fix Updates Available", but when I went to the Software Updates page, it showed me a bunch security updates. I do get and "Oops", so something might be janky.

@andreasn
Copy link
Contributor

The registration notification works as expected!

@martinpitt
Copy link
Member Author

@andreasn: You are on Fedora? cockpit-packagekit has a rather expensive workaround for https://bugs.freedesktop.org/show_bug.cgi?id=101070 . The current system page doesn't currently load all the details from all the updates, so it can't figure this out (it's also just a heuristics by parsing changelogs for CVEs). This should work fine on RHEL.

I don't have known oopses here, can you please post the log of it?

@andreasn
Copy link
Contributor

TypeError: self.refresh_os_updates_state is not a function[Learn More] system.js:3911:14

@martinpitt
Copy link
Member Author

@andreasn: I could reproduce your bug at last. subscription-manager is broken in Fedora 27, I just filed https://bugzilla.redhat.com/show_bug.cgi?id=1555384 . Once I fixed that locally, I got the crash as well, stupid typo :-) Thanks for finding! Fix pushed.

@martinpitt
Copy link
Member Author

Several tests fail on unexpected SELinux violations from rhsmd (example 1, example 2):

audit: type=1400 audit(1521046773.361:302): avc:  denied  { write } for  pid=1850 comm="rhsmd" name="nss" dev="dm-0" ino=12642789 scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=sock_file permissive=1
audit: type=1400 audit(1521046773.361:302): avc:  denied  { connectto } for  pid=1850 comm="rhsmd" path="/var/lib/sss/pipes/nss" scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:sssd_t:s0 tclass=unix_stream_socket permissive=1
type=1400 audit(1521047735.710:5): avc:  denied  { write } for  pid=1506 comm="rhsmd" name="encodings" dev="dm-0" ino=6446470 scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=dir
type=1400 audit(1521047735.744:6): avc:  denied  { write } for  pid=1506 comm="rhsmd" name="dbus" dev="dm-0" ino=12816715 scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=dir

These need to be reported downstream and naughty-ed.

@martinpitt
Copy link
Member Author

martinpitt commented Mar 15, 2018

rhsm is broken on our fedora-27 image due to a missing dependency, I filed that as https://bugzilla.redhat.com/show_bug.cgi?id=1556738. But I cannot reproduce the various SELinux violations manually, with either a busctl, or directly starting /usr/libexec/rhsmd or even with logging in on cockpit and have that do the d-bus call.

I do get the violations with running testAbrtReport locally, but that's not yet helpful for downstream. At least after sitting after that test cases' failure, the violations happen again straight after logging in. So that test triggers some change on the system.

Update: This is due to the test calling setenforce 0. If I run that plus busctl on subscription-manager, I get the messages.

@martinpitt martinpitt removed the blocked Don't land until something else happens first (see task list) label Mar 15, 2018
@martinpitt
Copy link
Member Author

I reported the rhsmd SELinux violations downstream, and added a naughty override. I also removed some obsolete SELinux disablings in the tests.

Copy link
Contributor

@andreasn andreasn left a comment

Choose a reason for hiding this comment

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

Looks good to me!
Awesome work!

@martinpitt
Copy link
Member Author

Ugh, on Windows 8 (with Edge) we get page oopses like mad due to Promise not being defined. Seems we need some polyfills here.. This is only being picked up by the tests now because the front page now calls this.

@martinpitt martinpitt added the blocked Don't land until something else happens first (see task list) label Mar 16, 2018
@martinpitt
Copy link
Member Author

I fixed the Promise oopses with IE in #8838, and included this here to already confirm with CI (tests run fine locally now, and I verified that the subscription/updates status works in IE). Setting to blocked until that PR lands.

@martinpitt martinpitt changed the title WIP: systemd: Show package updates status on front page systemd: Show package updates status on front page Mar 16, 2018
It is not necessary, we want to validate this behaviour in the default
system configuration (with SELinux enabled).
https://bugzilla.redhat.com/show_bug.cgi?id=1278287 got fixed in Fedora
23 three years ago already. Let's make sure we test it under the default
system configuration with SELinux enabled.
@martinpitt martinpitt removed the blocked Don't land until something else happens first (see task list) label Mar 17, 2018
@mvollmer mvollmer merged commit d04a7c8 into cockpit-project:master Mar 21, 2018
mvollmer pushed a commit that referenced this pull request Mar 21, 2018
Show a summary indicator on the system front page whether the host has
available package updates.

https://bugzilla.redhat.com/show_bug.cgi?id=1495543
Fixes #7758
Closes #8822
@martinpitt martinpitt deleted the system-updates-indicator branch March 21, 2018 13:12
martinpitt added a commit to martinpitt/cockpit that referenced this pull request Mar 22, 2018
With dnf we don't (currently) get a valid package update severity. In
these cases, stop showing "bug fix" for them, and just show "Updates
available" without further qualification. Do keep the bug icon for them
though.

Follow-up for PR cockpit-project#8822

Closes cockpit-project#8867
mvollmer pushed a commit that referenced this pull request Mar 23, 2018
With dnf we don't (currently) get a valid package update severity. In
these cases, stop showing "bug fix" for them, and just show "Updates
available" without further qualification. Do keep the bug icon for them
though.

Follow-up for PR #8822

Closes #8867
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.

There is no indicator in cockpit that there are updates available
3 participants