My Headlines

Ubuntu Service Failed to Start? Find the Error With systemctl and journalctl

When a system service fails on Ubuntu, use its status and logs to find the first specific error. These commands inspect the system without restarting services or editing configuration.

Find the failed unit

systemctl --failed --type=service

Copy the unit name from the list. The following examples use nginx.service. Replace it with your unit name.

systemctl status nginx.service --no-pager

Check the Active line, exit status and the recent log messages. A service that is inactive by design may not appear in the failed list. If you already know the name, check its status directly.

Read logs for this boot

journalctl -b -u nginx.service -n 50 --no-pager

-b limits the query to the current boot. -u selects the unit, and -n 50 limits the output to the most recent 50 entries. If the journal is unavailable to your account, ask an authorized administrator to run the same read-only query. Earlier boots are only available if their logs were retained.

Use the first concrete error

For example, if the log shows “Address already in use” before “Failed to start,” record the address and port and identify which application should use it. If the error says “No space left on device,” check the filesystem used by the service before clearing files. See the Ubuntu disk-space guide. Redact secrets and identifying details before sharing logs.

Ubuntu journalctl manual · Ubuntu systemctl manual.

Post a Comment

0 Comments