just had a discussion with a colleague about the proper design of a
systemd-based service, and my (admittedly sophomore) understanding is
that, in the service file, there is an [Install] section, which
contains a "WantedBy" line like:
fubar.service:WantedBy=sysinit.target
upon installation in the image, from systemd.bbclass. the routine
systemd_postinst() is invoked which (among other things), does this:
if [ "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
for service in ${SYSTEMD_SERVICE_ESCAPED}; do
systemctl ${OPTS} enable "$service"
done
fi
and my understanding is that it is that call to "systemctl" that
creates the appropriate symlink so that that service now exists under
the directory "sysinit.target.wants".
my need for confirmation is based on muh collegaue's pointing at
some existing systemd-based recipes in some legacy code, which
manually do the following in do_install_append():
ln -s ${sysconfdir}/systemd/system/fubar.service \
${D}/${sysconfdir}/systemd/system/sysinit.target.wants/
i'm pretty sure that that "ln" command is unnecessary as long as the
service file is defined properly, but now i just want to get that
confirmed.
rday
p.s. hmmmmmm ... i wonder if the original recipe designer was unaware
of systemd.bbclass and thought he had to do it all manually.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156621):
https://lists.openembedded.org/g/openembedded-core/message/156621
Mute This Topic: https://lists.openembedded.org/mt/86073990/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-