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

[flatpak] Predicate two cmds by gvfs service #3618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions sos/report/plugins/flatpak.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# See the LICENSE file in the source distribution for further information.

from sos.report.plugins import Plugin, IndependentPlugin
from sos.report.plugins import Plugin, IndependentPlugin, SoSPredicate


class Flatpak(Plugin, IndependentPlugin):
Expand All @@ -20,19 +20,27 @@ class Flatpak(Plugin, IndependentPlugin):

def setup(self):
env = {"GVFS_REMOTE_VOLUME_MONITOR_IGNORE": "1"}
gvfs_pred = SoSPredicate(
self, cmd_outputs={
'cmd': 'systemctl --user status gvfs-daemon.service',
'output': '(running)'
}
Comment on lines +23 to +27
Copy link
Member

Choose a reason for hiding this comment

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

SosPredicate() supports a service parameter to check for running services. Is that not sufficient here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about it, but I think the --user option is crucial difference here. Let me re-test it..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we get services list via systemctl list-unit-files --type=service and that output does not contain users' services, InitSystem is not aware of the service despite it is running. So service parameter is useless here /o.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ok, good observation. I guess that makes the question, should we expand our profiling for SystemdInit to include user services, or just go forward with this as written and keep our SystemD abstraction in the dark about user services?

)
self.add_cmd_output([
"flatpak --version",
"flatpak --default-arch",
"flatpak --supported-arches",
"flatpak --gl-drivers",
"flatpak --installations",
"flatpak --print-updated-env",
"flatpak config",
"flatpak remote-list --show-details",
"flatpak list --runtime --show-details",
"flatpak list --app --show-details",
"flatpak history --columns=all",
], env=env)
self.add_cmd_output([
"flatpak --installations",
"flatpak --print-updated-env",
], env=env, pred=gvfs_pred)
if self.get_option("verify"):
self.add_cmd_output("flatpak repair --dry-run", env=env)

Expand Down
Loading