I have a few units in my program, such as:
- program.service
- program-cleanup.service
- program-cleanup.timer
- ...
As well as a 'program-cleanup.preset' file which just says:
enable program-cleanup.timer
I am having trouble understanding how I should be setting up the files here. Currently my rpm.spec runs the following commands:
...
install -D -m 0644 %{_sourcedir}/build/program.service %{_unitdir}/program.service
install -D -m 0644 %{_sourcedir}/build/program-cleanup.service %{_unitdir}/program-cleanup.service
install -D -m 0644 %{_sourcedir}/build/program-cleanup.timer %{_unitdir}/program-cleanup.timer
install -D -m 0644 %{_sourcedir}/build/program-cleanup.preset %{_presetdir}/program-cleanup.preset
Do I need to run a systemctl preset program-cleanup.preset
in the %post
part of the .spec file? If I add more presets, would I have to add one more line per preset?