Linux systemctl Command: Manage systemd Services
systemctl checks the status of services and other units managed by systemd and controls starting, stopping, restarting, and enabling them at boot. When investigating a service failure, first check the current status with status.
What is the systemctl command?
start is the action to run immediately, and enable is the action to set it to start at boot. They do not automatically replace each other. active and enabled also refer to the current running state and boot setting, respectively. Specify the unit name clearly and check logs with journalctl -u.
Basic syntax
systemctl [option] command [unit]
Installed implementations and options may vary depending on the distribution. Check the description for the current system with man systemctl.
Examples
Checking service status
Replace example unit names with the actual service names on your system.
systemctl status sshd.service
Check if it is currently running
When checking status in a script, also check the exit status.
systemctl is-active sshd.service
Check auto-start settings on boot
See the enable status regardless of current execution.
systemctl is-enabled sshd.service
Distinguishing Service Status and Whether It Is Running
systemctl is-active service_name briefly tells you the current running status. The following service name should be changed according to your environment.
systemctl is-active sshd.service
Example output on a system where the service is running:
active
active means it is currently running. Automatic start on boot is separate, so check it with systemctl is-enabled sshd.service. Service names may vary depending on the distribution, and restart can cause disconnection, so after changing settings, first check the cause with status and journalctl -u.
start starts a service now, whereas enable changes its boot-time activation setting; neither action necessarily performs the other. After editing a unit file, run sudo systemctl daemon-reload to reload its definition, then restart the affected service only when appropriate and inspect its status and logs.
Main Options and Format
| Options/Format | Description |
|---|---|
status unit |
Displays status and a summary of recent logs. |
start / stop unit |
Starts or stops the unit currently. |
restart unit |
Stops and then starts again, so the connection may be interrupted. |
reload unit |
If the service supports it, it rereads the configuration without restarting. |
enable / disable unit |
Changes the automatic start setting at boot. |
Precautions when using
Stopping or restarting remote access services or running web services with stop/restart may interrupt connections and requests. First, check the unit name, change window, and recovery procedure. daemon-reload is the operation that rereads the changed unit definition, not a command to restart the service. It does not apply to systems that are not systemd.
Frequently Asked Questions
If I use systemctl enable, will the service start immediately?
Usually not. enable is a setting for automatic start at boot. To run it now, you need to execute start separately or use the supported --now option.
Official Documentation
You can check the exact behavior of options and differences by implementation in the official documentation related to systemctl.









