Systemctl cat is cool

Sometimes we want to see the content of a Systemd unit file. One obvious way to do it is to just cat/vim the content of the unit file directly. For example, to display the content of systemd-tmpfiles-clean.timer, we can perform the following step: ➜ systemctl status systemd-tmpfiles-clean.timer | grep Loaded Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static) ➜ cat /usr/lib/systemd/system/systemd-tmpfiles-clean.timer; # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2....

July 20, 2024 · 2 min · 306 words · kenno

Systemd List Failed Units and Services

This is a quick note to list failed services on systemd system. [root@zilla ~]# systemctl status ● zilla State: degraded Jobs: 0 queued Failed: 1 units Since: Fri 2020-09-04 02:20:47 AEST; 3 months 11 days ago CGroup: / ├─1 /usr/lib/systemd/systemd --system --deserialize 22 └─system.slice ├─httpd.service │ ├─21860 /usr/sbin/httpd -DFOREGROUND │ ├─21861 /usr/sbin/httpd -DFOREGROUND │ ├─21862 /usr/sbin/httpd -DFOREGROUND │ ├─21863 /usr/sbin/httpd -DFOREGROUND │ ├─21864 /usr/sbin/httpd -DFOREGROUND │ └─21865 /usr/sbin/httpd -DFOREGROUND ... [root@zilla ~]# systemctl list-units --failed UNIT LOAD ACTIVE SUB DESCRIPTION ● ipmi....

December 15, 2020 · 2 min · 233 words · kenno