On Wed, Jul 21, 2021 at 03:16:39AM -0700, Andrea Bolognani wrote:
On Tue, Jul 20, 2021 at 07:00:20PM +0200, Olaf Hering wrote:
> if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
> # See if user has previously modified their install to
> # tell libvirtd to use --listen
> - grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd
1>/dev/null 2>&1
> + if test -f /etc/sysconfig/libvirtd
> + then
> + grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd
1>/dev/null 2>&1
> + fi
I don't think you need to make this conditional: if the file doesn't
exist, grep will exit with a non-zero code, same as if the file
existed but no match was found in it.
Pre-existing: am I missing something, or is the daemon actually *not*
being restarted when --listen is found? We mask a bunch of units and
that's pretty much it.
Also pre-existing: do we even care about handling upgrades from
versions of the daemon that didn't have support for systemd socket
passing at this point? The .spec file explicitly limits support to
RHEL 8 and Fedora 33, which should be plenty recent enough to make
the entire dance unnecessary.
Yes, we need to support upgrades. RHEL only gained socket
activation in 8.3 (IIRC), and so we need this logic to support
upgrades from RHEL-7.x or 8.0-8.2
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|