How to Fix ‘Unit Not Found’ Systemd Error in Linux

Attempting to manage system services in Linux using systemctl start, systemctl enable, or systemctl status only to encounter the error “Failed to start example.service: Unit example.service not found” indicates that the system and service manager (systemd) cannot locate or parse a corresponding unit configuration file. In Linux distributions powered by systemd (such as Ubuntu, Debian, Fedora, Arch, and RHEL), systemd relies on unit configuration files (ending in .service, .socket, or .timer) stored in designated filesystem hierarchies. When a package installation omits daemon registration, unit manifests reside in custom non-indexed directories, or systemd has not refreshed its internal dependency graph following file changes, service execution aborts. This guide details how to locate service manifests, refresh the unit database, and resolve systemd unit loading failures.

What Causes the ‘Unit Not Found’ Error in Systemd?

The systemd unit discovery engine evaluates standardized configuration paths in a strict hierarchy:

  • Unloaded Daemon Configuration: A unit file was installed, modified, or moved, but the systemd manager has not executed daemon-reload to index it.
  • Package Service Name Discrepancies: The package name differs from the actual unit name (for example, installing apache2 on Fedora where the systemd unit is named httpd.service).
  • Orphaned or Broken Symlinks: Symbolic links in /etc/systemd/system/ pointing to non-existent unit targets.
  • Incorrect File Permissions or Syntax Errors: The unit file lacking read permissions for root (644) or containing malformed Section headers.
  • Masked Service Units: A service unit explicitly masked and symlinked to /dev/null to prevent automatic or manual execution.

Method 1: Reload the Systemd Daemon Manager

Forcing systemd to reread unit directories immediately registers newly installed or edited service files.

  1. Open your Linux terminal.
  2. Execute the daemon reload command with administrative privileges:
    sudo systemctl daemon-reload
  3. Attempt to query the service status again:
    sudo systemctl status example.service
  4. If systemd now recognizes the unit, enable and start it:
    sudo systemctl enable --now example.service

Method 2: Verify Exact Service Unit Names and Filesystem Locations

Confirm whether the unit file exists on disk and verify its naming convention.

  1. List all active, inactive, and loaded units matching your service keyword:
    systemctl list-unit-files | grep -i "example"
  2. Search standard systemd unit directories for the unit manifest:
    sudo find /etc/systemd/system /lib/systemd/system /usr/lib/systemd/system -name "*example*" 2>/dev/null
  3. Notice the location:
    • /etc/systemd/system/: System administrator created or customized unit files (highest priority).
    • /run/systemd/system/: Runtime units generated dynamically.
    • /lib/systemd/system/ or /usr/lib/systemd/system/: Upstream package maintainer unit files.
  4. If the file was saved with an incorrect name or missing .service extension, rename it accordingly.

Method 3: Check for and Unmask Masked Services

Masked units are linked to /dev/null, causing systemd to treat them as permanently inaccessible.

  1. Check if the service is currently masked:
    systemctl is-enabled example.service
  2. If the output returns masked, unmask the unit:
    sudo systemctl unmask example.service
  3. Reload the daemon configuration:
    sudo systemctl daemon-reload
  4. Start the service:
    sudo systemctl start example.service

Method 4: Fix File Permissions and Unit File Syntax

Ensure the service file has appropriate POSIX permissions so systemd PID 1 can parse its instructions.

  1. Verify permissions on the target unit file:
    ls -la /etc/systemd/system/example.service
  2. Standard systemd unit files must be owned by root:root with permissions set to 644:
    sudo chown root:root /etc/systemd/system/example.service
    sudo chmod 644 /etc/systemd/system/example.service
  3. Verify that the file contains required minimal sections:
    [Unit]
    Description=Example Application Service
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/usr/local/bin/example
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
  4. Run systemd-analyze verify to test syntax:
    systemd-analyze verify /etc/systemd/system/example.service
  5. Execute sudo systemctl daemon-reload and start the service.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.