Mailinglist Archive: opensuse-bugs (4251 mails)

< Previous Next >
[Bug 1038401] libvirt: Usage of systemctrl enable should be changed to %sytemd_add_pre/post
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Wed, 10 May 2017 20:36:39 +0000
  • Message-id: <bug-1038401-21960-L4avr9ZC0t@http.bugzilla.suse.com/>
http://bugzilla.suse.com/show_bug.cgi?id=1038401
http://bugzilla.suse.com/show_bug.cgi?id=1038401#c1

James Fehlig <jfehlig@xxxxxxxx> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |behlert@xxxxxxxx,
| |mlatimer@xxxxxxxx
Flags| |needinfo?(behlert@xxxxxxxx)

--- Comment #1 from James Fehlig <jfehlig@xxxxxxxx> ---
(In reply to Stefan Behlert from comment #0)
But currently we can see breakages in some products due to services that are
not following the guidelines as described in

https://en.opensuse.org/openSUSE:
Systemd_packaging_guidelines#Enabling_systemd_unit_files

Those guidelines only talk about the simple scenario of enabling a single
service.

The package
libvirt

was identified to use
"systemctl enable" in its spec-file, and it should get replaced by the
proper use of
%sytemd_add_pre/post and preset.

libvirt does use %service_add_{pre,post}, %service_del_{preun,postun}, etc.

Please check your package, thanks.

The only use of 'systemctl enable' in libvirt.spec is to handle an upgrade
scenario. From Factory libvirt.spec:

# In upgrade scenario we must explicitly enable virtlockd/virtlogd
# sockets, if libvirtd is already enabled and start them if
# libvirtd is running, otherwise you'll get failures to start
# guests
%triggerpostun daemon -- libvirt-daemon < 1.3.0
if [ $1 -ge 1 ] ; then
%if %{with_systemd}
/usr/bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
/usr/bin/systemctl enable virtlogd.socket || :
/usr/bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
/usr/bin/systemctl start virtlogd.socket || :
%else
/sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
/sbin/chkconfig virtlogd on || :
/sbin/service libvirtd status 1>/dev/null 2>&1 &&
/sbin/service virtlogd start || :
%endif
fi

I don't really see how to replace this logic with '%service_*' macros.
Suggestions or references for further reading are welcome. Thanks!

--
You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >
References