Yocto Tutorial - 25 SystemD Service Recipes (Part-1) | A Step-by-Step Tutorial

Опубликовано: 04 Октябрь 2024
на канале: Tech-A-Byte
1,519
17

This Tutorial explains how to integrate Systemd service file in Yocto via Recipd. In this video the following topics are covered.

SystemD Service:
A systemd service is a manageable unit of work in Linux.
Services can be custom applications, daemons, or system tasks.
They are defined by .service unit files, containing configuration details.
Advantages of SystemD Services:

Parallelization reduces boot times.
Dependency management ensures the correct service order.
Logging facilitates troubleshooting.
Resource management enhances system stability.
Service recovery automatically restarts failed services.
Standardization for consistency across Linux distributions.
Writing a Recipe for SystemD Service:

Create necessary code or scripts.
Define a .service unit file for service behavior.
Place files in your recipe, typically in the files directory.
Use do_install in the .bb recipe to copy files to the root filesystem.
Specify dependencies and metadata.
Placement of Service File in Root Filesystem:

Use do_install to specify the location in the root filesystem.
Typically follows the Filesystem Hierarchy Standard (FHS).
Enabling the Service by Default:

Set SYSTEMD_AUTO_ENABLE = "enable" in the recipe.
Define the service using SYSTEMD_SERVICE:${PN} = "sysd.service".
Basic SystemD Commands:

systemctl status servicename: Check service status.
systemctl start servicename: Start a service.
systemctl stop servicename: Stop a service.
systemctl restart servicename: Restart a service.
systemctl enable servicename: Enable a service at boot.
systemctl disable servicename: Disable a service at boot.
systemctl daemon-reload: Reload systemd daemons.

Github: https://github.com/Munawar-git/YoctoT...