[libvirt] [PATCH] spec: Restart libvirtd in posttrans

Pavel Hrdina phrdina at redhat.com
Tue Oct 24 10:23:36 UTC 2017


On Mon, Oct 23, 2017 at 06:07:49PM +0200, Pavel Hrdina wrote:
> On Mon, Oct 23, 2017 at 04:00:57PM +0200, Jiri Denemark wrote:
> > When upgrading libvirt packages, there's no strict ordering for the
> > installation or removal of the individual libvirt sub packages. Thus
> > libvirt-daemon may be upgraded (and its %postun scriptlet) started
> > before all sub packages with driver libraries are upgraded. When
> > libvirt-daemon's %postun scriptlet restarts the daemon old drivers may
> > still be laying around and the daemon may crash when it tries to use
> > them.
> > 
> > Let's restart the daemon in %posttrans to make sure libvirtd is
> > restarted only after all sub packages are at the same version.
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1464300
> > 
> > Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> > ---
> >  libvirt.spec.in | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Pavel Hrdina <phrdina at redhat.com>

After some discussion in person we might want to improve the spec file
to restart libvirtd only once.  In order to do that you can follow this
guide [1].  The idea is to create temporary file in %post which will
indicate that we should restart libvirtd and in %posttrans we will
restart libvirtd only if the file exists and remove it.  This will
ensure that only one %posttrans will actually restart libvirtd.

Pavel

[1] <https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Writing_Scriptlets>

> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171024/f59266cd/attachment-0001.sig>


More information about the libvir-list mailing list