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.