I want to know if there is a brief way to check the last 50 lines about a service that threw an error on restart.
$ sudo service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
I use an alias for checking that, tho I forget what the flags do.
alias jrn='sudo journalctl -eu'
$ jrn nginx
-- Reboot --
Jun 26 02:52:42 xi systemd[1]: Starting NGINX Plus - high performance web server...
Jun 26 02:52:42 xi systemd[1]: Started NGINX Plus - high performance web server.
Jun 26 04:03:16 xi systemd[1]: Stopping NGINX Plus - high performance web server...
Jun 26 04:03:16 xi systemd[1]: nginx.service: Succeeded.
Jun 26 04:03:16 xi systemd[1]: Stopped NGINX Plus - high performance web server.
Jun 26 04:03:16 xi systemd[1]: Starting NGINX Plus - high performance web server...
Jun 26 04:03:16 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use)
Jun 26 04:03:17 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use)
Jun 26 04:03:17 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use)
Jun 26 04:03:18 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use)
Jun 26 04:03:18 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use)
Jun 26 04:03:19 xi nginx[41832]: nginx: [emerg] still could not bind()
Jun 26 04:03:19 xi systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jun 26 04:03:19 xi systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 26 04:03:19 xi systemd[1]: Failed to start NGINX Plus - high performance web server.