3 ms·
Here's an excerpt from my cheat sheet: # Output all logs since boot journalctl # Follow all logs in real time journalctl -f # Output logs f
by dharmab 4y ago
Here's an excerpt from my cheat sheet:
# Output all logs since boot
journalctl
# Follow all logs in real time
journalctl -f
# Output logs for a given systemd unit
journalctl -u $unit
# Combine follow and unit flags to follow logs for a given systemd unit
# Easy to remember: You are saying F*** U to a broken piece of software
journalctl -fu $unit
# Output kernel logs
journalctl -k
# Follow kernel logs
journalctl -fk
# Tip: Use -b flag to see logs from previous boot cycles
# Learn more, including advanced filtering and formatting
man journalctl
You can also add that configtest command as an ExecStartPre to the unit, and it will run that before starting nginx and optionally fail early if it finds an error.
- __turbobrew__ 4y agoYou forgot: # Easy to remember: You are saying F**K because your kernel is broken journalctl -fk
- Rediscover 4y agoThank You