Linux failedMedium

Linux Service Startup Error: Diagnosis and Fixes

This article explains why a Linux service might fail to start with a 'failed to start' error and provides detailed troubleshooting steps using systemd and journalctl.

Updated at February 17, 2026
10-15 minutes
Medium
FixPedia Team
Применимо к:Ubuntu 20.04+Debian 10+CentOS 8+Fedora 35+

What the 'service failed to start' error means

The service failed to start error in Linux (most often in systemd-based systems) means that the service manager failed to successfully start a background process (daemon). This state is displayed in the output of the systemctl status command as active (failed) or inactive (dead). Typical output:

 ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2026-02-17 10:30:00 MSK; 1min 30s ago
  Process: 1234 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)

In this example, the ssh service terminated with error code 1/FAILURE at the ExecStartPre stage (pre-start script). The specific cause is always indicated in the logs, which must be examined.

Common causes

A service failing to start can be caused by the following common issues:

  1. Syntax error in the service configuration file (.service). Incorrect parameters, missing sections, typos.
  2. Missing or inaccessible executable file/script specified in ExecStart or ExecStartPre. The file may have been deleted, moved, or have incorrect permissions.
  3. Insufficient permissions to start. The service may require privileges (RootDirectory=, CapabilityBoundingSet=), or the user it runs as (User=) does not exist or lacks access.
  4. Resource conflict. The service attempts to occupy an already-used network port, file, socket, or other system resource.
  5. Unmet dependencies. Services specified in Requires= or After= are not running or have failed.
  6. Error in the application itself. The program launched by the service crashes immediately after start due to incorrect parameters, corrupted configs, or missing libraries.
  7. Session or environment issues. The service starts in a clean systemd environment, lacking variables present in a user session.

Solutions

Method 1: Analyzing logs with journalctl

Get detailed logs for the service, which will show the exact cause of the failure.

  1. Find the service name (e.g., nginx, postgresql).
  2. Run the command to view logs since the last boot:
    journalctl -u service_name -b
    
  3. Look for lines containing Failed, Error, permission denied, No such file or directory, Address already in use. Often the last 10-20 lines of the log contain the key information.

Example output for a failing service:

Feb 17 10:30:01 host systemd[1]: Starting My App Service...
Feb 17 10:30:01 host myapp[1234]: Error: Cannot open config file /etc/myapp/config.yaml: No such file or directory
Feb 17 10:30:01 host systemd[1]: myapp.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 10:30:01 host systemd[1]: myapp.service: Failed with result 'exit-code'.

Method 2: Checking and validating the configuration file

Ensure the service config is syntactically correct and paths are accurate.

  1. View the current configuration:
    systemctl cat service_name
    
  2. Check the file's syntax (if you edited it). Systemd has no built-in validator, but you can check if it loads:
    systemctl daemon-reload
    
    If the command completes without errors, the syntax is likely correct.
  3. Carefully check paths in directives:
    • ExecStart= — absolute path to the executable or script.
    • WorkingDirectory= — working directory (must exist).
    • ConfigFile= or similar application-specific parameters — do they point to existing files?

Method 3: Checking the existence and permissions of the executable file

Verify that the binary/script the service is supposed to launch exists and is accessible.

  1. Find the path from ExecStart in the config.
  2. Check if the file exists:
    ls -la /full/path/to/executable
    
  3. Check permissions:
    • The file must have execute bits (x) for the user/group the service runs as (by default — root).
    • Example of correct permissions: -rwxr-xr-x or -rwx--x--x.
    • If the service runs as a non-root user (via User= directive), ensure that user has permission to execute the file.

Method 4: Diagnosing dependencies and conflicts

Ensure all required services are running and there are no resource conflicts.

  1. Review dependencies in the config (Requires=, After=, Wants=). For each dependent service, run:
    systemctl status dependent_service_name
    
    It should be in active (running) state.
  2. If the service uses a network port, check if it's already in use:
    sudo ss -tulpn | grep :port_number
    
    If the port is already occupied by another service, change the port in your service's config or stop the conflicting process.
  3. Check if the service is trying to claim the same resource twice (e.g., a socket in /run/).

Method 5: Manual execution for diagnostics

Run the command specified in ExecStart manually as the same user the service uses. This will show errors directly in the terminal.

  1. Determine the user (User= in the config; if absent, default is root).
  2. If the service runs as a non-root user, switch to it:
    sudo -u username -i
    
  3. Execute the ExecStart command manually, adding debugging flags if needed (e.g., --verbose).
  4. An error that might be compressed in systemd logs is often printed in full detail when run manually.

Method 6: Recreating units and clearing state

If the service was deleted/moved, or systemd state is "stuck".

  1. Remove and recreate symbolic links for the unit:
    sudo systemctl daemon-reload
    sudo systemctl reset-failed service_name  # resets the failed state
    
  2. Try starting again:
    sudo systemctl start service_name
    
  3. For services that were completely removed, ensure there are no "zombie" files in /etc/systemd/system/ or /lib/systemd/system/. Delete old files and repeat daemon-reload.

Prevention

  • Always use systemctl daemon-reload after manually editing service files in /etc/systemd/system/ or /lib/systemd/system/.
  • Check application configuration files referenced by the service (e.g., nginx -t for Nginx, postgresql -t for PostgreSQL).
  • Do not run services as root unless necessary. Specify a dedicated user/group in User= and Group=. This reduces security risks and permission issues.
  • Monitor system updates. Package updates can change service configuration files or executables. After an update, check the status of critical services.
  • Use systemctl status and journalctl as your first commands for any failure — they provide 80% of the information about the problem.

F.A.Q.

What is systemd and why are services managed through it?
How to view logs for a service that fails to start?
Can the error be due to insufficient user permissions?
What to do if a dependent service fails to start?

Hints

Check service status
Examine full service logs
Check service configuration file
Ensure executable file exists and is accessible
Check dependencies and conflicts

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community