« Back to Systemd: Frequently Asked Questions

How to check if a systemd service is enabled?

How to check if a systemd service is enabled?

Use the systemctl command with the 'is-enabled' subcommand, followed by the service.

Systemd units can be enabled, making them available for startup during boot time of the system.

To see if a unit, such as a service, is actually enabled, use the is-enabled subcommand of systemctl.

Using systemctl is-enabled

Using the subcommand is very easy, as it only requires a unit name.

# systemctl is-enabled ssh.service
enabled

In this case the service is showing enabled, meaning it is enabled. An alternative way is to look at the output of the status subcommand. In that case look at the line starting with Loaded: and look at the value directly after the unit name.

# systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-10-14 17:29:58 UTC; 1 month 24 days ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 403504 (sshd)
      Tasks: 1 (limit: 2219)
     Memory: 488.0K
        CPU: 21ms
     CGroup: /system.slice/ssh.service
             └─403504 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Notice: journal has been rotated since unit was started, output may be incomplete.

Other questions related to Systemd

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon