Skip to content

Commit ab8864e

Browse files
markstoskeszybz
authored andcommitted
man: provide a basic guide to the systemctl status output (systemd#4950)
- Show example of all `systemctl status` output and documents what possible "Loaded:", "Active" and "Enabled" values mean. - Documents what different colors of the dot mean. - Documents "gotcha" with load-on-demand behavior which will report units as "loaded" even if they are only loaded to show their status. (From @poettering: systemd#5063 (comment) )
1 parent e843b04 commit ab8864e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

man/systemctl.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,56 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
876876
a similar filter for messages and might be more
877877
convenient.
878878
</para>
879+
880+
<para>Systemd implicitly loads units as necessary, so just running the <command>status</command> will
881+
attempt to load a file. The command is thus not useful for determining if something was already loaded or
882+
not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
883+
to keep it in memory thereafter.
884+
</para>
885+
886+
<example>
887+
<title>Example output from systemctl status </title>
888+
889+
<programlisting>$ systemctl status bluetooth
890+
● bluetooth.service - Bluetooth service
891+
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
892+
Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
893+
Docs: man:bluetoothd(8)
894+
Main PID: 930 (bluetoothd)
895+
Status: "Running"
896+
Tasks: 1
897+
Memory: 648.0K
898+
CPU: 435ms
899+
CGroup: /system.slice/bluetooth.service
900+
└─930 /usr/lib/bluetooth/bluetoothd
901+
902+
Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
903+
Jan 12 10:46:45 example.com.com bluetoothd[8900]: Current Time Service could not be registered
904+
Jan 12 10:46:45 example.com.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
905+
</programlisting>
906+
907+
<para>The dot ("●") uses color on supported terminals to summarize the unit state at a glance. White
908+
indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a
909+
<literal>failed</literal> or <literal>error</literal> state and green indicates an
910+
<literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state.
911+
</para>
912+
913+
<para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into
914+
memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem
915+
loading it, <literal>not-found</literal>, and <literal>masked</literal>. Along with showing the path to
916+
the unit file, this line will also show the enablement state. Enabled commands start at boot. See the
917+
full table of possible enablement states — including the definition of <literal>masked</literal> — in the
918+
documentation for the <command>is-enabled</command> command.
919+
</para>
920+
921+
<para>The "Active:" line shows active state. The value is usually <literal>active</literal> or
922+
<literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
923+
The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or
924+
<literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service
925+
failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
926+
entered the cause will be logged for later reference.</para>
927+
</example>
928+
879929
</listitem>
880930
</varlistentry>
881931
<varlistentry>

0 commit comments

Comments
 (0)