Service changes on Linux often happen during configuration edits, package upgrades, or incident response, and the wrong systemctl action can either leave a daemon using old settings or interrupt live clients. Managing the unit directly separates one-time state changes, boot enablement, reloads, restarts, and final status checks.
Most server-oriented Linux distributions run background services under systemd as units such as ssh.service, nginx.service, or cron.service. systemctl talks to the system manager, starts and stops the selected unit, changes enablement links for boot behavior, and displays the loaded unit state without editing the service configuration itself.
A reload asks the daemon to reread its own configuration while the process stays in place, and it works only when the unit defines a reload action. A restart stops and starts the service, so plan it around remote access, long-running requests, and dependent services; use daemon-reload only after changing unit files or drop-ins, not after ordinary application configuration edits.
Steps to manage a Linux service with systemctl:
- Search for the target service unit name.
$ systemctl list-unit-files --type=service 'ssh*.service' --no-pager UNIT FILE STATE PRESET ssh.service disabled enabled sshd-keygen.service enabled enabled sshd-unix-local@.service alias - sshd.service alias - sshd@.service indirect enabled 5 unit files listed.
Replace ssh*.service with a pattern for the daemon being managed. Debian and Ubuntu commonly use ssh.service, while some distributions expose the OpenSSH server as sshd.service or an alias.
- Check the current service state before changing it.
$ sudo systemctl status --no-pager --full ssh.service * ssh.service - OpenBSD Secure Shell server Loaded: loaded (/usr/lib/systemd/system/ssh.service; disabled; preset: enabled) Active: inactive (dead) Docs: man:sshd(8) man:sshd_config(5)Loaded shows the unit file and boot enablement state. Active shows the runtime state.
Related: How to check Linux service status - Reload systemd unit definitions after creating or editing a unit file or drop-in.
$ sudo systemctl daemon-reload
This reloads unit metadata for systemd. It does not reload the daemon's own application configuration.
- Start the service for the current boot.
$ sudo systemctl start ssh.service
- Confirm that the service entered the active state.
$ systemctl is-active ssh.service active
systemctl is-active returns a zero exit status only when the unit is active.
- Reload the service after a validated configuration change.
$ sudo systemctl reload ssh.service
If the unit does not implement reload, use sudo systemctl reload-or-restart ssh.service only when a restart is acceptable.
- Restart the service when a full process reinitialization is required.
$ sudo systemctl restart ssh.service
A restart can interrupt active work for many services. Keep a recovery path before restarting access services such as SSH on a remote host.
- Stop the service when it should be offline.
$ sudo systemctl stop ssh.service
Socket-activated services can start again when the socket receives traffic. Check a matching .socket unit when a stop does not hold.
- Confirm that the stopped service is inactive.
$ systemctl is-active ssh.service inactive
- Enable the service at boot and start it now.
$ 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'.
--now starts the service after the boot enablement links are updated.
- Confirm that the service is enabled for boot.
$ systemctl is-enabled ssh.service enabled
- Disable automatic startup and stop the service now.
$ sudo systemctl disable --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 disable ssh Removed '/etc/systemd/system/multi-user.target.wants/ssh.service'. Removed '/etc/systemd/system/sshd.service'.
Omit --now when the current process should keep running until a later stop or reboot.
- Confirm that the disabled service is stopped.
$ systemctl is-active ssh.service inactive
- Confirm that the service is disabled for boot.
$ systemctl is-enabled ssh.service disabled
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.