[Pkg-libvirt-maintainers] Bug#973489: libvirt-daemon-system: upgrade overwrites generated file /etc/libvirt/qemu/networks/default.xml
Andrea Bolognani
eof at kiyuko.org
Mon Nov 9 23:20:13 GMT 2020
On Fri, Nov 06, 2020 at 11:35:06AM +0100, Guido Günther wrote:
> On Sat, Oct 31, 2020 at 05:50:23PM +0100, Thorsten Glaser wrote:
> > I suspect this file should not have been a conffile, i.e. not
> > shipped in /etc (but somewhere under /usr and copied to /etc
> > during postinst).
> >
> > NOTE: Migrating to _that_ setup is dangerous as well, see #971683
> > for what can happen when done naïvely.
>
> Hmmm...it used to be in /etc since it was *not* autogenerated. Andrea
> do you know if anything changed in that regard?
As far as I can tell, the file has had at least some part of its
contents autogenerated since
https://gitlab.com/libvirt/libvirt/-/commit/5d09c314952b23a303aa40a0d7b9854dd0ae86dd
I agree that it should probably not be in /etc; in fact, the upstream
spec file deals with it pretty much how Thorsten suggested above:
%install
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
$RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml; then
UUID=`/usr/bin/uuidgen`
sed -e "s/${orig_sub}/${sub}/g" \
-e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
< %{_datadir}/libvirt/networks/default.xml \
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
fi
We should do something similar in Debian as well, possibly including
shipping the default network configuration in a separate binary
package. I'll look into it over the next few days :)
--
Andrea Bolognani <eof at kiyuko.org>
Resistance is futile, you will be garbage collected.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-maintainers/attachments/20201110/f047c95f/attachment.sig>
More information about the Pkg-libvirt-maintainers
mailing list