What it does
systemctl COMMAND UNIT is the main tool for services on RHEL. start/stop/restart act now; enable/disable decide what starts at boot; status shows the state and the last log lines. Without a type, a name means .service.
It also lists units, shows and edits unit files (cat, edit), sets the default boot target, and powers the system off or reboots it. With --user it manages the services of your own user session.
How to write it
systemctl [OPTION]... COMMAND [UNIT]...Main parts
Units now
startUNIT...- Start units.
stopUNIT...- Stop units.
restartUNIT...- Stop and start.
try-restartUNIT...- Restart only if running.
reloadUNIT...- Re-read the config without stopping.
reload-or-restartUNIT...- Reload if possible, else restart.
killUNIT...- Send a signal to the processes of a unit.
cleanUNIT...- Remove cache, logs, state of a unit.
freeze/thawUNIT...- Pause / continue all processes of a unit.
isolateTARGET- Start this target and stop all others.
Boot
enableUNIT...- Start at boot (
--nowalso starts now). disableUNIT...- Do not start at boot.
reenableUNIT...- Disable and enable again (new links).
presetUNIT...- Set enabled/disabled to the preset of the vendor.
maskUNIT...- Block the unit completely (link to /dev/null).
unmaskUNIT...- Remove the block.
get-default- Show the default boot target.
set-defaultTARGET- Set the default boot target.
State
status[UNIT...|PID...]- State, PID, cgroup and last log lines.
is-activeUNIT...- Print active/inactive (exit code 0 = active).
is-enabledUNIT...- Print enabled/disabled/static/masked.
is-failedUNIT...- Check for the failed state.
is-system-running- Overall state: running, degraded …
list-units- Loaded units (
-ttype,--state). list-unit-files- Installed unit files and their enable state.
list-dependenciesUNIT- Dependency tree.
list-sockets,list-timers,list-jobs,list-automounts,list-paths- Lists of these types.
showUNIT- All properties (
-psome).
Unit files
catUNIT...- Show the unit file and drop-ins.
editUNIT- Create a drop-in override (
--full= whole copy). revertUNIT...- Remove your overrides.
daemon-reload- Reload all unit files after manual changes.
set-propertyUNITNAME=VALUE...- Change resource settings (like MemoryMax) at run time and keep them.
linkFILE,add-wants,add-requires- Other unit file commands.
set-environment,unset-environment,show-environment- Environment of the manager.
System
reboot- Reboot.
poweroff- Power off.
halt- Stop the system without power off.
suspend,hibernate,hybrid-sleep- Sleep modes.
rescue- Go to rescue mode.
emergency- Go to emergency mode.
default- Go to the default target.
soft-reboot- Restart user space only (newer systemd).
reset-failed[UNIT...]- Clear the failed state.
Options 57
Most used
Select
Output
Behaviour
Nothing matches this filter.
Examples 15
$ run as a normal user# run as root (or with sudo)
1Start a service now and at boot
systemctl enable --now httpd Created symlink '/etc/systemd/system/multi-user.target.wants/httpd.service' → '/usr/lib/systemd/system/httpd.service'.The RHCSA way: running now and after reboot.
2Status of a service
systemctl status sshdLoaded/enabled, Active, Main PID and the last 10 log lines.
3Short checks for scripts
systemctl is-active httpd; systemctl is-enabled httpd active enabledThe exit code is 0 when the answer is yes.
4Restart and reload
systemctl restart httpd systemctl reload httpdreload keeps open connections; not every service supports it.
5Find failed services
systemctl --failedStart here after a boot with problems.
6List running services
systemctl list-units -t service --state=runningWhat runs now.
7Which services start at boot?
systemctl list-unit-files -t service --state=enabledReview this list: fewer services = smaller attack surface.
8Override settings safely
systemctl edit httpd systemctl cat httpdThe drop-in goes to /etc/systemd/system/httpd.service.d/.
9Block a service
systemctl mask --now cupsNot even a dependency can start it.
10Default boot target
systemctl get-default systemctl set-default multi-user.targetText mode at the next boot.
11Show some properties
systemctl show sshd -p MainPID,ActiveState,RestartGood for scripts and checks.
12Limit memory of a service at run time
systemctl set-property httpd MemoryMax=1GKept after reboot (use --runtime for a test).
13Rate the security of a service
systemd-analyze security sshdExposure score from 0 (safe) to 10 (unsafe).
14Your own user services
systemctl --user list-units -t serviceServices in your session (like podman containers with Quadlet).
15Reboot with a reason
systemctl reboot --message="Kernel update KB-2026-10"The reason goes to the journal.
Nothing matches this filter.
Watch out
startalone does not survive a reboot;enablealone does not start now.- After editing unit files by hand, run
systemctl daemon-reload. isolatestops everything that is not part of the target (also your SSH session in rescue).
Files
/usr/lib/systemd/system/- Unit files from packages.
/etc/systemd/system/- Your units, overrides and enable links.
/run/systemd/system/- Run-time units.
~/.config/systemd/user/- User units.
Exit codes
0 :: Done (is-active/is-enabled: yes). 1 :: Failed or not active/enabled (also used by status for a dead unit with a pid file). 3 :: status: the unit is not active. 4 :: No such unit.