Skip to content

Systemd service won't start: how to find the cause

Medium 15 min Updated:

Quick answer

When a systemd service won't start, first check the status with `systemctl status service-name` and review the logs using `journalctl -u service-name`. The cause may be a configuration error, a missing file, incorrect permissions or a failed dependency. Follow the steps for systematic diagnosis.

How to recognize the problem

  • Service is in failed or inactive state
  • Starting the service returns an error
  • Service starts then immediately crashes
  • Application on the port does not respond
  • Error messages appear in the logs

Most common causes

Service configuration error

An invalid unit file, wrong path to the executable or missing parameters prevent startup.

Missing permissions or ownership

The service may not have rights to read configuration, write to a directory or access the network.

Dependency not met

The service depends on another service, network or disk mount that is not available at startup time.

Port is occupied

Another application is already using the port the service is trying to bind to.

Missing files or libraries

The executable, configuration file or shared library does not exist at the expected location.

Step-by-step fix

  1. 1

    Check service status

    Run systemctl status service-name. Pay attention to the state (failed, inactive) and the latest error messages. The status often gives the first hint of the cause.

  2. 2

    Review the logs

    Use journalctl -u service-name -xe for detailed logs. The -e option jumps to the end, and -x provides explanations. If the service recently crashed, add --since "10 min ago".

  3. 3

    Check the unit file

    Run systemctl cat service-name to see the contents of the unit file. Make sure the paths to the executable and configuration are correct and that there are no syntax errors.

  4. 4

    Test the executable manually

    Run the command from ExecStart manually as the user specified in User=. If it works manually, the problem is in the service environment (variables, permissions).

  5. 5

    Check permissions and ownership

    Make sure the service user has read and write rights to the necessary directories. Use ls -l and namei -l to check the path.

  6. 6

    Check dependencies

    Run systemctl list-dependencies service-name. Make sure all dependencies are active. You can manually start the dependent service and try again.

  7. 7

    Check if the port is occupied

    Use sudo ss -tulnp | grep :PORT to see which process holds the port. If it is occupied, check which process it is and stop it only if safe, or change the port in the configuration.

  8. 8

    Reload systemd and start the service

    After modifying the unit file, run systemctl daemon-reload, then systemctl start service-name. Check the status again.

If nothing helps

If the service still won't start, check if there is a resource limit (e.g. LimitNOFILE) or SELinux/AppArmor. If you are testing SELinux, temporarily switch it to permissive mode (setenforce 0) only on a test system and immediately switch back to enforcing mode (setenforce 1); do not disable protection permanently on a production system. Also check the system logs (journalctl -b) for errors not directly related to the service. For complex cases, run the command from ExecStart under strace -f to see where it stops.

How to prevent it

  • Regularly update systemd and services
  • Use `systemd-analyze verify` to check unit files
  • Set up monitoring for critical services
  • Keep a record of configuration changes

When to call a professional

If you have tried all the steps and the service still doesn't work, or if you don't have access to the root account, contact IT support. They can analyze the system more deeply and safely apply advanced techniques.

IT infrastructure maintenance · Servers, networks, backup, security and helpdesk

FAQ

How do I see all logs for a service?

Use `journalctl -u service-name` without the `-e` option to see all entries. You can add `-f` to follow logs in real time.

What does the error "status=203/EXEC" mean?

It indicates that systemd could not execute the command from `ExecStart`. Check the path, permissions and whether the file exists.

How do I change the user under which the service runs?

Change `User=` in the unit file (preferably via `systemctl edit service-name`), then run `systemctl daemon-reload` and restart the service.

Share
Didn't find a fix?The AI IT assistant is available 24/7. Describe the problem or send a screenshot of the error and get instructions for your case.Ask the AI IT assistant