From Fedora Project Wiki

(.service/.timer files as %config)
(BuildRequires: systemd-rpm-macros)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:


"''Systemd unit .service files must not be marked as %config files.''" - I disagree, those are files commonly customized ('''.service''' ones for example nice/idle daemon priority). It does not mention '''.timer''' files, those also should be %config so that their modifications do not get lost.
"''Systemd unit .service files must not be marked as %config files.''" - I disagree, those are files commonly customized ('''.service''' ones for example nice/idle daemon priority). It does not mention '''.timer''' files, those also should be %config so that their modifications do not get lost.
The section on filesystem locations says the service files must got into '''%{_unitdir}''', but in reality they might need to go into '''%{_userunitdir}''' instead if they are targeted for user sessions. Using '''systemctl --user enable <service>''' doesn't work if it is in the system location ('''%{_unitdir}''').
Use '''BuildRequires: systemd-rpm-macros''' instead of '''BuildRequires: systemd''' if only systemd macros definitions are needed.

Latest revision as of 13:22, 30 September 2022

What I am missing is a explicit guideline on whether one should continue packaging init scripts and unit files or drop the init scripts in Rawhide

-- Rahul Sundaram


There should be mentioned rule about files in /var/run and /var/lock. Regular files in /var/run and /var/lock directories should be packaged as %ghost. For directories use tmpfiles.d(5) mechanism without %ghost. --plautrba


"Systemd unit .service files must not be marked as %config files." - I disagree, those are files commonly customized (.service ones for example nice/idle daemon priority). It does not mention .timer files, those also should be %config so that their modifications do not get lost.


The section on filesystem locations says the service files must got into %{_unitdir}, but in reality they might need to go into %{_userunitdir} instead if they are targeted for user sessions. Using systemctl --user enable <service> doesn't work if it is in the system location (%{_unitdir}).


Use BuildRequires: systemd-rpm-macros instead of BuildRequires: systemd if only systemd macros definitions are needed.