This is a draft cheat sheet. It is a work in progress and is not finished yet.
Definitions
Systemd |
System and service manager |
Units |
Resources managed by systemd |
Mount |
A mount unit specifies how a file system can be mounted on a specific directory. |
Socket |
A socket creates a method for applications to communicate with one another. This can be defined as a file or a port. |
| ->ListenStream |
TCP Port used by service listed in service file. |
| ->ListenDatagram |
UDP Port used by service listed in service file. |
Target Unit |
A simple definition of a target unit is “a group of units.” Formerly comparable to run levels in previous iterations of RHEL. |
Want |
A symbolic link is known as a want, as it defines what the target wants to start when it is processed. |
|
Unit File Location & Precedence
/run/systemd/system |
Contains unit files that have automatically been generated. |
/etc/systemd/system |
Contains custom unit files. It may also contain include files that have been written by an administrator or generated by the systemctl edit command. |
/usr/lib/systemd/system |
Contains default unit files that have been installed from RPM packages. You should never edit these files directly. |
|
Systemd Commands
systemctl -t help |
display a list of available units |
systemctl list-dependencies [service] |
display an overview of any existing dependencies. |
systemctl list-dependencies [service] --reverse |
find out which units are dependents of this unit. |
systemctl [enable/disable] |
ensure that a unit is automatically started/disable while booting. |
systemctl show |
To figure out which options are available for a specific unit. |
systemctl show [service] |
Shows all Systemd options that can be configured in the [service].service unit, including their current default values. |
systemctl edit |
creates a subdirectory in /etc/systemd/system for the service that you are editing with an override.conf file that will overwrite any existing settings in the service file in /usr/lib/systemd/system |
|
Tips
Systemd Text Editior |
swap the default editor in /root/.bash_profile file to include the following line: export SYSTEMD_EDITOR="/bin/vim" |
|