Size: 1955
Comment:
|
Size: 2128
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
The '''systemd project''' is an amalgamation of init processes and service managers. | '''systemd''' is an amalgamation of init processes and service managers. |
Line 15: | Line 15: |
== Unit Files == | == Usage == |
Line 17: | Line 17: |
The systemd project is configured using '''unit files'''. A unit file's functionality is hinted by its file extension: * services (.service) * mount points (.mount) * devices (.device) * sockets (.socket) |
A service is configured with a '''unit file'''. A unit file's functionality is hinted by its file extension: |
Line 23: | Line 19: |
Server-level unit files are located in `/etc/systemd`. User-level unit files are located in | * services (`.service`) * mount points (`.mount`) * devices (`.device`) * sockets (`.socket`) Operating system unit files are located in `/usr/lib/systemd` and symlinked to `/etc/systemd` to enable them. User process unit files are located in `$HOME/.config/systemd/user` and symlinked to `/etc/systemd/user` to enable them. |
Line 27: | Line 28: |
=== Replacing Unit Files === | === Overwriting Unit Files === |
Line 29: | Line 30: |
To replace the unit file `/usr/lib/systemd/system/foo`, create the file `/etc/systemd/system/foo` and re-enable. Alternatively, try: |
To overwrite a unit file, try: |
Line 34: | Line 33: |
systemctl edit --full unit | systemctl edit --full foo |
Line 36: | Line 35: |
Alternatively but not recommended: to overwrite `/usr/lib/systemd/system/foo`, create an editted copy at `/etc/systemd/system/foo`. In either case, reloading the service will cause the new configuration to be used. |
|
Line 41: | Line 44: |
A '''drop-in file''' is a segment of a unit file that is parsed and applied over the pre-existing unit file. | A '''drop-in file''' is a partial unit file that is patched over the primary unit file at load time. |
Line 43: | Line 46: |
To create drop-in files for the unit file `/usr/lib/systemd/system/foo`, create the directory `/etc/systemd/system/foo.d/` and place `.conf` files there to override or add new options. Alternatively, try: |
To create a drop-in file, try: |
Line 48: | Line 49: |
systemctl edit unit | systemctl edit foo |
Line 51: | Line 52: |
Alternatively but not recommended: to edit `/usr/lib/systemd/system/foo`, create the directory `/etc/systemd/system/foo.d/` and place `.conf` files within it. | |
Line 52: | Line 54: |
=== Reverting Unit Files === To revert changes to a unit file, try: |
To revert edits to a unit file, try: |
Line 58: | Line 57: |
systemctl revert unit | systemctl revert foo |
Line 65: | Line 64: |
== Daemon Configuration == | == Configuration == |
Line 67: | Line 66: |
If a unit file takes too long to start at boot, systemd switches to verbose mode and prints information that may help in diagnosing issues. This setting can be explicitly disabled in `/etc/systemd/system.conf`. | If a unit file takes too long to start at boot, `systemd(1)` switches to verbose mode and prints information that may help in diagnosing issues. This setting can be explicitly disabled in `/etc/systemd/system.conf`. |
Systemd
systemd is an amalgamation of init processes and service managers.
First and foremost, it is the server daemon systemd(1). It is also the userland interfaces systemctl(1) and journalctl(1).
The systemd project also encompasses systemd-networkd, systemd-resolved, systemd-timerd, systemd-logind, systemd-homed, systemd-firewalld, among a few others.
Usage
A service is configured with a unit file. A unit file's functionality is hinted by its file extension:
services (.service)
mount points (.mount)
devices (.device)
sockets (.socket)
Operating system unit files are located in /usr/lib/systemd and symlinked to /etc/systemd to enable them. User process unit files are located in $HOME/.config/systemd/user and symlinked to /etc/systemd/user to enable them.
Overwriting Unit Files
To overwrite a unit file, try:
systemctl edit --full foo
Alternatively but not recommended: to overwrite /usr/lib/systemd/system/foo, create an editted copy at /etc/systemd/system/foo.
In either case, reloading the service will cause the new configuration to be used.
Editing Unit Files
A drop-in file is a partial unit file that is patched over the primary unit file at load time.
To create a drop-in file, try:
systemctl edit foo
Alternatively but not recommended: to edit /usr/lib/systemd/system/foo, create the directory /etc/systemd/system/foo.d/ and place .conf files within it.
To revert edits to a unit file, try:
systemctl revert foo
Configuration
If a unit file takes too long to start at boot, systemd(1) switches to verbose mode and prints information that may help in diagnosing issues. This setting can be explicitly disabled in /etc/systemd/system.conf.
[Manager] ShowStatus=no