Bug 90727 - systemctl list-dependencies colors should match systemctl
Summary: systemctl list-dependencies colors should match systemctl
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium minor
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 16:09 UTC by Felipe Sateler
Modified: 2018-06-11 14:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Felipe Sateler 2015-05-28 16:09:52 UTC
Currently list-dependencies prints a colored dot by default indicating status: green is active, red is inactive.

This is not documented in the man page for systemctl.

A paragraph like the following might help:

            <para>If the <option>--plain</option> option is not specified,
            each unit will be prefixed by a colored dot, indicating the
            current activity status of the unit. Green indicates the unit is
            currently active, red indicates the unit is inactive.</para>



However, that is a lot of states to collapse into red: a unit may be inactive because it is failed, or perhaps it just wasn't pulled in by anything, or it maybe doesn't even exist. Red also marks oneshot units that exited successfully!

I think using the same color scheme as systemctl status use for the active state makes sense: uncolored for inactive without errors (including not found units), yellow for condition failures, and red for error states.
Comment 1 Ken Stailey 2015-07-01 12:40:50 UTC
I would like to point out that the --plain does not suppress printing the colored dots (systemd version 216-25.fc21).  That option only suppresses the line drawing characters that are described as "tree" format.

If stdout is not a tty (instead a regular file or a pipe) the dots are still printed but without the red and green colors.

The systemctl program needs some work to improve output so that it is parsable by coreutils programs.
Comment 2 Javi Barroso 2016-06-10 06:35:19 UTC
Hello,

It would be good to add black color (not started, condition failed) to man page indications

may be we can have a systemd-colors man page ? and make a reference on all the commands where colors are used ? 

Thank you !
Comment 3 Zbigniew Jedrzejewski-Szmek 2016-06-10 14:09:14 UTC
The scheme used by 'list-dependencies' should be changed to match 'status'. Anything else is just too confusing.

We might want to document the color scheme somewhere in systemctl(1). I don't think we should add a separate man page, because we already have 200+ systemd man pages, the color scheme is not guaranteed to be stable, it might be adjusted in the future, and we should not give too much prominence to it.
Comment 4 Zbigniew Jedrzejewski-Szmek 2018-06-11 14:54:33 UTC
The color scheme is now that green is used for active, white for inactive, red for failed. So this seems to be fixed since a while. If further adjustments are needed, please open a bug under https://github.com/systemd/systemd/issues.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.