0% found this document useful (0 votes)
60 views1 page

Systemd Command Reference Guide

This document provides a cheatsheet comparing common commands used with SysV init and Systemd to start, stop, enable, disable, and check the status of system services and targets. It includes notes on equivalent commands between the two systems and descriptions of commands specific to Systemd.

Uploaded by

Asds
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views1 page

Systemd Command Reference Guide

This document provides a cheatsheet comparing common commands used with SysV init and Systemd to start, stop, enable, disable, and check the status of system services and targets. It includes notes on equivalent commands between the two systems and descriptions of commands specific to Systemd.

Uploaded by

Asds
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Systemd Cheatsheet

Sysvinit Command Systemd Command Notes


service httpd start systemctl start [Link] Used to start a service (not reboot persistent).
service httpd stop systemctl stop [Link] Used to stop a service (not reboot persistent).
service httpd restart systemctl restart [Link] Used to stop and then start a service.
service httpd reload systemctl reload [Link] When supported, reloads the config file without
interrupting pending operations.
service httpd condrestart systemctl condrestart [Link] Restarts if the service is already running.
service httpd status systemctl status [Link] Tells whether a service is currently running.
service --status-all systemctl list-units --type service Displays the status of all services.
ls /etc/rc.d/init.d/ systemctl list-unit-files --type=service Used to list the services that can be started or
stopped. Used to list all the services and other
units.
chkconfig httpd on systemctl enable [Link] Turn the service on, for start at next boot, or other
trigger.
chkconfig httpd off systemctl disable [Link] Turn the service off for the next reboot, or any
other trigger.
chkconfig httpd systemctl is-enabled [Link] Used to check whether a service is configured to
start or not in the current environment.
chkconfig --list systemctl list-unit-files --type=service Print a table of services that lists which runlevels
ls /etc/systemd/system/*.wants/ each is configured on or off.
chkconfig httpd --list ls /etc/systemd/system/*.wants/[Link] Used to list what levels this service is configured
on or off.
chkconfig httpd --add systemctl daemon-reload Used when you create a new service file or modify
any configuration.

Sysvinit Runlevel Systemd Target Notes


0 [Link], [Link] Halt the system.
1, s, single [Link], [Link] Single user mode.
2, 4 [Link], [Link], [Link] User-defined/Site-specific runlevels - identical to 3.
3 [Link], [Link] Multi-user, non-graphical. Users can usually login via
multiple consoles or via the network.
5 [Link], [Link] Multi-user, graphical. Usually has all the services of run-
level 3 plus a graphical login.
6 [Link], [Link] Reboot
emergency [Link] Emergency shell

Command Notes
systemctl get-default Determine which target unit is used by default.
systemctl set-default [Link] Change default boot target to [Link].
journalctl -b Show all messages from this boot.
journalctl -b -p err Show all messages of priority levels ERROR (4) and worse, from the
current boot.
journalctl -p warning --since="2014-06-14 [Link]" View the warning or higher priority messages from certain point in time.
journalctl -f Follow new messages.
journalctl -u SERVICE Show only log of SERVICE.
journalctl /usr/sbin/httpd Show all messages by a specific executable.
journalctl --full Display full (= not truncated) messages.
systemctl --state=failed Lets find the systemd services which fail to start.
systemctl list-units --type=target Show current runlevel.
systemctl isolate [Link] Changes the current target (runlevel).
systemctl rescue/emergency Changing to Rescue(single user mode)/Emergency Mode.
systemctl kill [Link] Kill SERVICE (all processes) with SIGTERM.
systemctl --failed List failed services on boot.
systemd-cgls cgroup tree
systemctl show -p "Wants" [Link] What other units does a unit depend on?
systemctl list-jobs Check for possibly stuck jobs use.
systemctl list-dependencies Show units and it’s dependencies.

Old Command Systemd Command Description


halt systemctl halt Halts the system.
poweroff systemctl poweroff Powers off the system.
reboot systemctl reboot Restarts the system.
pm-suspend systemctl suspend Suspends the system.
pm-hibernate systemctl hibernate Hibernates the system.
pm-suspend-hybrid systemctl hybrid-sleep Hibernates and suspends the system.

You might also like