Skip to content

Commit

Permalink
metrics.systemd-cglog: don't check for "running" state of already-sta…
Browse files Browse the repository at this point in the history
…rted units, to match scopes/slices as well
  • Loading branch information
mk-fg committed Nov 8, 2024
1 parent b3a90ee commit 79195a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/systemd-cglog
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def main(args=None):
for u in json.loads(sp.run(
['systemctl', 'list-units', '-ao', 'json'],
check=True, stdout=sp.PIPE ).stdout)
if unit_st(u) == ('loaded', 'active', 'running') and
if unit_st(u)[:2] == ('loaded', 'active') and
fnmatch.fnmatch(u['unit'], opts.unit_fnmatch) )

for sig in signal.SIGINT, signal.SIGTERM:
Expand Down

0 comments on commit 79195a0

Please sign in to comment.