Units
Any entity managed by systemd >[!example]-
>
Location
- /lib/systemd/systemd standard systmed unit files
- /usr/lib/systmed/system for locally installed packages (via apt-get)
- /run/systemd/systemd transient unit files
- /etc/systemd/system custom unit files
Systemd targets
Way of managing relation between units It’s basically groups processor on phases and start them in a correct order
- Target types
- Service units: These represent system services.
- Target units: These are used to group units and act as synchronization points during boot-up.
- Device units: These represent devices in the system.
- Mount units: These define mount points for file systems.
- Socket units: These represent inter-process communication sockets.
- Timer units: These define timer-based activation of other units.
- Path units: These trigger activation of other units based on file system events.
- Snapshot units: These are used to save the state of the systemd manager.
- Last state is multi-user.target
u can move between the targets
*!!This will rollback to a given target!!
Systemd procedures
[!bug] Always execute the systemctl daemon-reload command After creating new unit files or modifying existing unit files. systemctl deamon-reload
-
Mask Unmask Blocks the service u can’t start it or enable ,it creates a service that points to the devnull
-
Reload service Try to reload the config and apply changes
-
Restart Service Close the program and re-run it without the check
New way
Old way
See what was dirscly when the unit was started
Example ssh
Configuration
[!example]- Docs configuration
Systemd Timers
[!example]
Restart
Important * by restarting thesystemd-journald
, you 'll loose all the logging of the current session
so it's recommended to do the following cmd :