Controlling services on Linux keeps maintenance predictable during configuration changes, upgrades, and incident response. Reliable start, stop, restart, and reload actions reduce downtime and make recovery steps repeatable.

Most modern distributions run background processes as systemd units, and systemctl communicates with the systemd manager to control them. Service units are commonly named name.service, with unit files typically stored under /usr/lib/systemd/system (distribution packages) and /etc/systemd/system (local overrides and custom units).

Reloading is preferred when a daemon supports it because configuration is re-read without a full process teardown, but many units do not implement reload. Restarting interrupts active work and can disconnect clients, so validating the unit state and recent logs before and after changes helps prevent avoidable outages.

Steps to manage a Linux service with systemctl:

  1. List installed service unit files to confirm the unit name.
    $ systemctl list-unit-files --type=service | head -n 8
    UNIT FILE                                    STATE           PRESET
    apt-daily-upgrade.service                    static          -
    apt-daily.service                            static          -
    autovt@.service                              alias           -
    console-getty.service                        enabled-runtime disabled
    container-getty@.service                     static          -
    cryptdisks-early.service                     masked          enabled
    cryptdisks.service                           masked          enabled

    systemctl accepts both service-name and service-name.service.

  2. Check the current service state from the status output.
    $ sudo systemctl status --no-pager --full ssh.service | head -n 14
    * ssh.service - OpenBSD Secure Shell server
         Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled)
         Active: active (running) since Sun 2026-01-11 21:40:20 UTC; 37s ago
    TriggeredBy: * ssh.socket
           Docs: man:sshd(8)
                 man:sshd_config(5)
       Main PID: 1292 (sshd)
          Tasks: 1 (limit: 14999)
         Memory: 1.2M (peak: 2.9M)
            CPU: 21ms
         CGroup: /system.slice/ssh.service
                 `-1292 \"sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups\"
    
    Jan 11 21:40:20 host.example.net systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...

    The bottom section shows recent log lines for the unit.

  3. Start the service.
    $ sudo systemctl start ssh.service
  4. Stop the service.
    $ sudo systemctl stop ssh.service
    Stopping 'ssh.service', but its triggering units are still active:
    ssh.socket

    Stopping a shared dependency can take down other services that require it. Socket-activated units may auto-start the service again.

  5. Reload the service configuration when the unit supports reload.
    $ sudo systemctl reload ssh.service

    Use reload-or-restart when a reload is preferred but not guaranteed: sudo systemctl reload-or-restart service-name.

  6. Restart the service to reinitialize the process.
    $ sudo systemctl restart ssh.service

    A restart drops existing connections and can abort in-flight work.

  7. Reload systemd unit definitions after creating or editing a unit file.
    $ sudo systemctl daemon-reload

    Required after changes under /etc/systemd/system. No services are restarted by this command.

  8. Enable the service to start at boot.
    $ sudo systemctl enable --now ssh.service
    Synchronizing state of ssh.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable ssh
    Created symlink /etc/systemd/system/sshd.service -> /usr/lib/systemd/system/ssh.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service -> /usr/lib/systemd/system/ssh.service.

    Use --now to start immediately during enablement: sudo systemctl enable --now service-name.

  9. Disable the service from starting at boot.
    $ sudo systemctl disable ssh.service
    Synchronizing state of ssh.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install disable ssh
    Removed \"/etc/systemd/system/multi-user.target.wants/ssh.service\".
    Removed \"/etc/systemd/system/sshd.service\".
    Disabling 'ssh.service', but its triggering units are still active:
    ssh.socket

    Use --now to stop immediately during disablement: sudo systemctl disable --now service-name.

  10. Confirm whether a service is active without the full status output.
    $ systemctl is-active ssh.service
    active

    Common states include active, inactive, and failed.

  11. Confirm whether a service is enabled at boot without the full status output.
    $ systemctl is-enabled ssh.service
    enabled

    Common states include enabled, disabled, static, and masked.