From f0cf514eb3ca30c5170e534c3861ad73996c7726 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 22 Aug 2023 21:38:08 +0000 Subject: deploy: 9bb639287cae88b32fc1b17b7a4b494340e54434 --- linux/systemd.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'linux/systemd.html') diff --git a/linux/systemd.html b/linux/systemd.html index 5ebe003..65a6dc4 100644 --- a/linux/systemd.html +++ b/linux/systemd.html @@ -83,7 +83,7 @@ @@ -175,6 +175,9 @@
systemctl [opts] [cmd]
 [opts]
     --user
+    --type=TYPE             List only given types eg, service, timer, socket (use --type=help for a list)
+    --state=STATE           List only given states eg running, enabled (use --state=help for a list)
+    --failed                List only failed services
 
 [cmd]
     list-units <pattern>    List units in memory
@@ -192,6 +195,13 @@
     cat <unit>      Print unit file
     show <unit>     Show properties of unit
 
+

Example: List failed units

+
# List all system failed units.
+systemctl --failed
+
+# List all user failed units.
+systemctl --user --failed
+

Example: Trivial user unit

# Generate unit
 mkdir -p ~/.config/systemd/user
-- 
cgit v1.2.3