If you want to install a service, which is a process that usually starts on boot and runs in the background, then you must include some additional definitions in your recipe.
If you are adding services and the service initialization
script or the service file itself is not installed, you must
provide for that installation in your recipe using a
do_install_append
function.
If your recipe already has a do_install
function, update the function near its end rather than
adding an additional do_install_append
function.
When you create the installation for your services, you need
to accomplish what is normally done by
make install
.
In other words, make sure your installation arranges the output
similar to how it is arranged on the target system.
The OpenEmbedded build system provides support for starting services two different ways:
SysVinit: SysVinit is a system and service manager that manages the init system used to control the very basic functions of your system. The init program is the first program started by the Linux kernel when the system boots. Init then controls the startup, running and shutdown of all other programs.
To enable a service using SysVinit, your recipe
needs to inherit the
update-rc.d
class.
The class helps facilitate safely installing the
package on the target.
You will need to set the
INITSCRIPT_PACKAGES
,
INITSCRIPT_NAME
,
and
INITSCRIPT_PARAMS
variables within your recipe.
systemd: System Management Daemon (systemd) was designed to replace SysVinit and to provide enhanced management of services. For more information on systemd, see the systemd homepage at http://freedesktop.org/wiki/Software/systemd/.
To enable a service using systemd, your recipe
needs to inherit the
systemd
class.
See the systemd.class
file
located in your
Source Directory.
section for more information.