Systemctl: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
 
* [[Systemd_Operations#systemctl|systemd Operations]]
* [[Systemd_Concepts#systemctl|systemd Concepts]]
* [[systemd#Operations|systemd]]
* [[systemd#Operations|systemd]]
* [[journalctl]]


=Overview=
=Overview=
Line 21: Line 23:
==list-units==
==list-units==


Lists loaded units.
Lists loaded ''active'' units.
 
In order to list all loaded units (active or inactive), use -a or --all:
 
<pre>
systemctl list-units --all
</pre>
 
==is-enabled==
 
Tells whether the service is enabled at boot.
 
==is-active==
 
Tells whether the service is running, or it was shut down.
 
==status==


==show==
==show==
Line 29: Line 47:
==enable==
==enable==


{{Internal|Custom_systemd_Unit_and_Unit_File#Enable_at_Boot|Enable a unit at boot}}
{{Internal|Systemd_Concepts#Start_.28Enable.29_a_Service_Automatically_at_Boot|Enable a Service at Boot}}
==disable==
 
<syntaxhighlight lang='bash'>
systemctl disable haproxy
</syntaxhighlight>


==start==
==start==


Start (activate) one or more units.
Start (activate) one or more units.
{{Internal|Systemd_Concepts#Starting_a_Service|Start a service}}


==stop==
==stop==


Stop (deactivate) one or more units.
Stop (deactivate) one or more units.

Latest revision as of 22:23, 19 August 2023

Internal

Overview

See

systemd Concepts - Services

-q (quiet)

Suppress output to standard output in snapshot, is-active, is-failed, is-enabled, is-system-running, enable and disable. However, it does not suppress output to stderr, which happens when the unit in question does not exists, etc.

You may want to consider:

systemctl -q .... 2>/dev/null

Commands

list-units

Lists loaded active units.

In order to list all loaded units (active or inactive), use -a or --all:

systemctl list-units --all

is-enabled

Tells whether the service is enabled at boot.

is-active

Tells whether the service is running, or it was shut down.

status

show

Show properties of one or more units.

enable

Enable a Service at Boot

disable

systemctl disable haproxy

start

Start (activate) one or more units.

Start a service

stop

Stop (deactivate) one or more units.