The manual page man systemctl
explains why that doesn't work for you:
When used with status
, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument, or 0 to disable journal output. Defaults to 10.
So systemctl status example.service -n 5
shows LESS rather than more/all information.
...
Note that this operation only displays runtime status, i.e.
information about the current invocation of the unit (if it is
running) or the most recent invocation (if it is not running anymore,
and has not been released from memory).
But in the same paragraph it does instruct you what to do instead to get information about previous invocations:
Information about earlier
invocations, invocations from previous system boots, or prior
invocations that have already been released from memory may be
retrieved via journalctl --unit=
.
Note that for many of my services I'll see a warning "Journal has been rotated":
systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2023-08-11 15:31:26 CEST; 6 days ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 21095 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Main PID: 888 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─ 888 /usr/sbin/httpd -DFOREGROUND
└─30179 /usr/sbin/httpd -DFOREGROUND
Warning: Journal has been rotated since unit was started.
Log output is incomplete or unavailable.
^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^
Where that last line is crucial and explains that the recommended action of running journalctl --unit=
shows nothing particularly useful for me:
journalctl --unit=httpd.service
-- No entries --
Your mileage may vary for that.