[opensuse-packaging] %service_add / %service_del consistency
Hi, After some bugreports about default enabling services, I found some inconsistencies in our current usage of %service_add/del_section macros that hinder work. Especially if %service_add_pre is missing, the default enablement will not work. So if you use %service_..., it must be present in all 4 sections. In %pre %service_add_pre SERVICE.service In %post %service_add_post SERVICE.service In %preun %service_del_preun SERVICE.service In %postun %service_del_postun SERVICE.service I fixed some already myself and have asked my new colleague Johannes to do some more fixes and perhaps also enhance rpmlint to detect missing sections. You can and should also check your own packages with these systemd units. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Marcus Meissner (meissner@suse.de) wrote:
Hi,
After some bugreports about default enabling services, I found some inconsistencies in our current usage of %service_add/del_section macros that hinder work.
Especially if %service_add_pre is missing, the default enablement will not work.
So if you use %service_..., it must be present in all 4 sections.
In %pre %service_add_pre SERVICE.service
In %post
%service_add_post SERVICE.service
In %preun %service_del_preun SERVICE.service
In %postun %service_del_postun SERVICE.service
I fixed some already myself and have asked my new colleague Johannes to do some more fixes and perhaps also enhance rpmlint to detect missing sections.
You can and should also check your own packages with these systemd units.
Thanks a lot for the info! However please can this be added to the wiki? Mailing list posts is no substitute for documentation, and unfortunately it seems that %service_* are not documented yet; at least, not in the right place :-/ https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On May 20, 2014, at 8:15 AM, Adam Spiers <aspiers@suse.com> wrote:
Marcus Meissner (meissner@suse.de) wrote:
Thanks a lot for the info! However please can this be added to the wiki? Mailing list posts is no substitute for documentation, and unfortunately it seems that %service_* are not documented yet; at least, not in the right place :-/
https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
It is at least listed on https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines but I agree, they should be listed there (if just as a link to the systemd packaging page), and probably a note added to %fillup_and_insserv. (Which, BTW, does that still apply? I know insserv/chkconfig wrap systemd now, and work on both init scripts and systemd unit files, so does %fillup_and_insserv properly enable a service, if the four systemd service macros are in place?) Also, you probably want to wrap the %service_* stuff inside %suse_version checks, so your packages will still build on SLES 11 and openSUSE evergreen. -Andrew-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Adam Spiers
-
Andrew Daugherity
-
Marcus Meissner