Some handy systemd/journal tips
I thought I would share some nifty little systemd/journal commands I have run into in the past year that are handy.
- easy way to make sure something restarts on fail: mkdir /etc/systemd/systemd/nameofthing.conf.d then make a nameofthing-override.conf in that dir with: [Service] Restart=always
- systemd-delta - Gives you the list of things that have changed from the 'default' units. Ones overridden, diff of any that were edited, etc.
- journalctl --list-boots - Gives you a list of boots (with also the number you can use with the next command) and times/dates.
- journalctl -b N - where N is the boot you want information from. I use this all the time with -1 or -2 to see how things changed in the previous 2 boots.
- systemctl status PID - you can pass this any PID and it will give you the status of the unit that started it/controls it. Very handy to see what some random process is a part of.
- systemctl suspend -i - Ignore any inhibitors and just suspend. This is like a --force, so be careful if you are in the middle of something like a package update.
- systemd-inhibit --list - shows you all suspend inhibitions and who asked for them.
- journalctl --disk-usage - show usage of journal logs on disk. You can tune them then in /etc/systemd/journald.conf