Systemd#
Commands and Locations#
custom services are stored here:
/etc/systemd/systemanalyse security of service unit:
systemd-analyze security <service_unit>restart a service:
systemctl restart <application_name>.serviceshow logs of a service:
journalctl -u <application_name>.service
List Services#
list enabled services:
systemctl list-unit-files --state=enabledlist running services:
systemctl list-units --type=servicelist failed services:
systemctl --failedlist timers:
systemctl list-timers
List all since boot#
all boot cycles:
journalctl -k -b allcurrent boot :
journalctl -klast boot:
journalctl -k -b -1two boots prior:
journalctl -k -b -2and so on
Journal#
delete old journal files (ony keep last 2 days):
journalctl --vacuum-time=2d