OS - Red Hat Enterprise Linux 8
I've created a
.spec file to build and package my application. My
rpm also includes
my_app.service file for
systemd to start it. However, by default one has to enable this with
systemctl enable my_app.service. I'd like to have it enabled after the
rpm has been installed. I've googled and found that I can use systemd.preset, which says:
It is not recommended to ship preset files within the respective software packages implementing the units, but rather centralize them in a distribution or spin default policy, which can be amended by administrator policy.
Does it mean I should not be adding
.preset file in my rpm? Also, later in the
man page it says:
If no preset files exist, systemctl preset will enable all units that are installed by default.
If I read it correctly, then my application's service file should be automatically enabled, but it is not happening, or this implies the manual
systemctl preset ?