1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-21 14:50:12 +03:00

6 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b08d86dc4a analyze: use DumpUnitsMatchingPatternsByFileDescriptor
Similarly to DumpByFileDescriptor vs Dump,
DumpUnitsMatchingPatternsByFileDescriptor is used in preference. Dissimilarly,
a fallback to DumpUnitsMatchingPatterns is not done on error, because there is
no need for backwards compatibility.

The code is still more verbose than I'd like, but there are four different code
paths with slightly different rules in each case, so it's hard to make this all
very brief. Since we have a separate file dedicated to making those calls, the
verbose-but-easy-to-follow implementation should be OK.

Closes #24989.

I only did a quick test that all both variants works locally and over ssh.
2022-10-18 08:45:45 +02:00
Zbigniew Jędrzejewski-Szmek
293b9aa3eb manager: rename dbus method
Fixes #24989.
2022-10-14 18:31:33 +02:00
Franck Bui
d1d8786c5b analyze: extend the dump command to accept patterns
The new function DumpPatterns() can be used to limit (drastically) the size of
the data returned by PID1. Hence the optimization of serializing data into a
file descriptor should be less relevant than having the possibility to limit
the data when communicating with the service manager remotely.

NB: when passing patterns, the dump command omits the version of the manager as
well as the features and the timestamps.
2022-10-13 07:47:42 +09:00
Zbigniew Jędrzejewski-Szmek
fddad5f4a6 analyze: allow verbs to return positive failure
No functional change is intended. The verbs where it wasn't immediately
clear if the success exit status is 0 or >= 0 are changed to explicitly
return 0. (I think it's better to be explicit than to rely on some call
stack always returning 0 on success.)

Some other functions are cleaned up to be more idiomatic.
2022-05-19 08:02:29 +02:00
Lennart Poettering
ef38bedbf9 analyze: systematically name verb entry point functions verb_xyz()
Some of the functions so far were named do_xyz(), others dump_xyz() and
even others test_xyz(). let's instead name them exactly like the verb
exposed in the command line, just prefixed with verb_
2022-02-21 17:22:23 +01:00
Lennart Poettering
25eb70af8b analyze: split out "dump" verb 2022-02-21 17:22:23 +01:00