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?
question from:
https://stackoverflow.com/questions/65661946/what-are-the-correct-commands-in-rpm-spec-to-set-up-the-systemd-preset 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…